melreams.com

Nerrrrd

Git tip of the day

Today’s tip is a very simple git feature that I always seem to forget. Maybe by putting it on my blog I’ll finally remember it exists!

git reset --hard origin/<branch name>

What this does is force your local branch to really for really real match the state of the remote branch. If somebody reverts a bad commit on a remote branch and your local repo insists your copy is a commit ahead of the remote no matter how many times you try a simple git reset, then that command up there is what you need to fix things.

Git tip of the day

Git is more than a little intimidating when you’re first getting started. Fortunately my friend Jen Reiher made this excellent flow chart to help you. Also, tell me that URL isn’t awesome :)

The reason I like this flowchart so much is that it’s really clearly broken down into steps and doesn’t drown you in information you don’t need. A lot of git guides start talking about branching and merging right away, and while those are important concepts they’re not necessary if you just want to put a simple project up on github so other people can see your code.