Live data from Hacker News

Some bad Git situations and how I got myself out of them

ohshitgit.com

151–160 of 352 posts

Re: Some bad Git situations and how I got myself out of them

#151

I can't believe no one has responded yet with "use a GUI". After gaining a basic understanding of how branches and merges work, and I do mean basic , I've never been able to screw up a local repo with a GUI client enough that I haven't been able to recover with the same GUI tools. I understand that people need to know how to use their tools, but for git most people can get away with the very basic usage that GUIs pro…

Its true -- and actually the well designed gui that accurately depicts the graphical state of your local repository makes it far easier to learn the concepts behind git than does the command line. Distributed vc is conceptually nuanced, but not overly complicated -- the complexity of git really is in the interface wherein you are asked to map command line syntax into abstract operations that manipulate a state that y…

This looks like an awesome way to learn git, and many would probably love to continue with it - but many others too would prefer to move to the CLI.

I used to use a GUI for git, but now I just find them cumbersome; by their nature requiring me to switch window for less.

Re: Some bad Git situations and how I got myself out of them

#153
post #152

Oh shit, I commited a binary file larger than 100 mb and now i can't push to github.com. Solution: https://rtyley.github.io/bfg-repo-cleaner/

Is there some tool that runs a full internal consistency check on a git repo?

Because otherwise, how can I be sure that some tool didn't mess up my repo, and one day I'll be getting error messages when checking out files, etcetera?

Re: Some bad Git situations and how I got myself out of them

#154
post #152

Oh shit, I commited a binary file larger than 100 mb and now i can't push to github.com. Solution: https://rtyley.github.io/bfg-repo-cleaner/

Is there some tool that runs a full internal consistency check on a git repo? Because otherwise, how can I be sure that some tool didn't mess up my repo, and one day I'll be getting error messages when checking out files, etcetera?

git fsck

Re: Some bad Git situations and how I got myself out of them

#155

Surprised he finds git to be complicated. It probably is deep down, but for day-to-day use, compare it to SVN. Until I switched, there was always a panic when branching or merging. With git, I can branch like a nutter and things seem to still work out in the end. Not sure why, perhaps someone else has a perspective on it.

In my experience it's all fine and dandy until you hit a rebase or merge that needs manual attention.

Re: Some bad Git situations and how I got myself out of them

#156
Based on the article, and many of the comments here, I didn't realise how comfortable I have become using git!

For example, the last "bad situation" I had to get myself out of involved unreadable .git contents caused by filesystem corruption. If you can "rm -rf fucking-git-repo-dir" then it's not too bad; when that fails with an IO error is when things get interesting!

Re: Some bad Git situations and how I got myself out of them

#157

I can't believe no one has responded yet with "use a GUI". After gaining a basic understanding of how branches and merges work, and I do mean basic , I've never been able to screw up a local repo with a GUI client enough that I haven't been able to recover with the same GUI tools. I understand that people need to know how to use their tools, but for git most people can get away with the very basic usage that GUIs pro…

I'm curious: What are the best free GUI for Git?

Re: Some bad Git situations and how I got myself out of them

#158
post #154

Earlier quoted context omitted.

Is there some tool that runs a full internal consistency check on a git repo? Because otherwise, how can I be sure that some tool didn't mess up my repo, and one day I'll be getting error messages when checking out files, etcetera?

git fsck

This. Also, hold on to the commit before you started refactoring (preferably by placing a temporary branch there, in order to avoid premature garbage collection). Then after your refactoring is done, `git fsck` and `git diff --stat $old_branch..HEAD` to verify that you did not lose any important content during the refactoring.

Re: Some bad Git situations and how I got myself out of them

#160

I can't believe no one has responded yet with "use a GUI". After gaining a basic understanding of how branches and merges work, and I do mean basic , I've never been able to screw up a local repo with a GUI client enough that I haven't been able to recover with the same GUI tools. I understand that people need to know how to use their tools, but for git most people can get away with the very basic usage that GUIs pro…

Interesting. I've always been too scared of git GUIs to seriously try them out. The fear being I will somehow mess up the repo by using the GUI wrong.
Post reply on HN