Skip to content
olu online

Getting out of a Git mess - what to do when you run into issues in Git

The commands and techniques that have always helped me when Git gets into a spot of bother.

Preventative Measures

Try to commit as often as you can; at least as often as you've added any significant feature or change. This makes it much easier to step back through history and find a place before you messed up.

Try to give yourself descriptive and well-formatted commit messages. A few too many 'WIP' and 'fixing bug' commits make any problems much harder to untangle.

The Actual Fixes

If you've never heard of it Oh Shit, Git is indispensible when you're first grappling with Git issues. Having things answered in plain English is really helpful when the panic of being in over your head sets in.

It's not a replacement for knowing Git well but it will take you a long way!

For a more in-depth look at the issues, Wizard Zines Git issue (also named Oh Shit, Git ha ha) is much more in-depth and explains why the commands work the way they do.

I hope this goes some way towards demystifying things!