Useful Git commands

Sometimes when using apps checked out from Git an update might break something so it’s good to know a few git commands. Move to root of the app folder you had checked out to perform git commands.

git log

This command will list all the commits so you can see at which commit you are and pick the one before yours and copy the commit hashcode it will be a long string.

git checkout hashcode

With ‘hashcode’ being the commit hashcode copied from the log. This command will move/revert your app/code to the commit you specified. Just restart your app after that to run it with the new code.

git checkout master

This command will move your code to the master branch from development. Do this if you want your app to be more stable Alpha/Developement branches break now and then as people checkin new code. They have the benefit of getting new features before the stable branch if you don’t mind having something break now and then which is ok with me 🙂

Leave a Reply