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…
Some bad Git situations and how I got myself out of them
191–200 of 352 posts
Re: Some bad Git situations and how I got myself out of them
#192Well, there are many more situations you can get into. Like cherry picking, force pushing, merge --no-commit, rebasing... almost any operation can end up going wrong. Just pay attention.
cd ..
sudo rm -r fucking-git-repo-dir
git clone https://some.github.url/fucking-git-repo-dir.gitRe: Some bad Git situations and how I got myself out of them
#193 git revert
git push
It leaves a history of the mistake, for better or worse, but it does undo the mistake on origin.Re: Some bad Git situations and how I got myself out of them
#194Re: Some bad Git situations and how I got myself out of them
#195Earlier quoted context omitted.
sorry... you come across as a git-sheep. (getting down-voted for it, but someone has to say it)
I'm prepared to give you a lot of examples (which other people might value differently). From the unfortunate consequences of the 'branches are files (and therefore tags are easily mutable by default and surprisingly hard to pin down)' to usual "I just committed, why does 'svn log' not show that?", to git bisect, to git clean and the stubbornness with which svn refuses to even consider implementing that.
tags should not be committed to... end-of-story.
as for 'svn-log not showing commits'... I've never heard of that one in the last decade of using it... I'm genuinely interested in how that came about.
Re: Some bad Git situations and how I got myself out of them
#196One of the nice workflows that's already built in to the git command line tools is this one. When you're working on a branch and realise that a commit you made a few commits back has a mistake in it: # Make correcting change git commit --all --fixup= # Continue working on branch, then at some point git rebase --interactive --autosquash The --fixup option creates commits with subjects formatted like 'fixup! previous c…
Re: Some bad Git situations and how I got myself out of them
#197One thing not covered very well was what to do if you push to origin. My favourite way to fix this: use git revert to create an exact opposite commit to your bad commit. git revert git push It leaves a history of the mistake, for better or worse, but it does undo the mistake on origin.
Re: Some bad Git situations and how I got myself out of them
#198Re: Some bad Git situations and how I got myself out of them
#199Re: Some bad Git situations and how I got myself out of them
#200Earlier quoted context omitted.
I don't know how it compares to GitUp, but SmartGit works on Linux, Windows, and macOS. I use it on all three platforms and recommend it highly. See my other comment in the subthread for more thoughts about it.
It's not free software though.