Here’s a list of git commands that I’ve used to tackle different situations:
Rolling back tree to avoid complicated git pull conflicts
git reset --hard # undo "git pull" which caused the conflicts git reset HEAD~N # rollback N commits git checkout -f # remove local files changes git status # check status; manually rm untracked files if necessary git pull # redo git pull
Combining and/or reordering patches
git rebase -i HEAD~20 # interactively edit the last 20 patches
Detect file renames when creating patch
git-format-patch -4 -M # the -M option ask git to detect renames
Creating a group-shareable repository for the first time
git-init --bare --shared=group # read this for subsequent steps
That’s all for now!
