Reminder to read the official git book. It’s free and it’s useful. My dudes, stop pretending to understand your tools and actually learn them.
I like this graphic, some of my favourites:
git log --oneline
is super useful for getting just a list of title of commits and nothing elsegit bisect
is a little known but extremely useful git archaeology command that automates binary searching for a regression.I just learned git bisect from https://ohmygit.org/! You run it, then checkout other commits all over the project, and mark them with git bisect good or git bisect bad. Then it paints all commits that led to the good one as good, and all the ones after the bad one as bad, so you just keep narrowing your window by playing checkout Jezzball until there’s only one commit left: the one that introduced the bad state.
tl;dr
git add . git commit -a git push
You dropped
--force
Gits motto should be “fuck around and find out”
More like “don’t fuck around but find out anyway”.
“Fuck around, have no idea HOW you fucked around, fuck around some more trying to fix it, find out how badly you’ve collectively fucked around”
That’s what the reflog is for!
Tangent are these VCS Rosetta Stones that might be interesting to some:
-
Darcs/Git/Mercurial: https://darcs.net/RosettaStone
-
I always forget how to do the delete distant branch with the : IIRC.