Stupid Git

4 March 2017

Will this wind be so mighty as to lay low the mountains of the earth?

No, which is why we’ve come up on the mountain to be safe, you stupid git.

Behind git clone, commit, pull and push there’s plenty to read about in git help. My cribsheet - I’m generally tracking a master branch at origin/master.

Action Command
Push changes only for a specific branch git push -u origin feature_branch_name
Revert changes to a file on a branch (after committed) git checkout origin/master file_to_revert
Revert all changes on branch (before committed) git checkout .
Revert specified file changes on branch interactively git checkout -p file_name
Merge changes from separate branch (e.g. master) into current git merge origin/master
Create and switch to branch git checkout -b new_branch_name
Checkout (switch to) an existing local branch git checkout existing_local_branch
Rename (move) the current local branch git -m new_branch_name
Show staged changes that will be committed git diff --cached

Up here on the mountain we shall be safe. Safe as houses

And what will happen to the houses?

Well naturally they’ll all be swept away and consuméd by the fire what is dancing on the Jeroboam - and serve ‘em bloody-well right as far as I’m concerned.

Spoiler alert - 1 Kings 14:10 - "I will bring harm upon the house of Jeroboam and will cut off from Jeroboam every male, both bond and free in Israel, and will burn up the house of Jeroboam". Other translations are available