$ git commit -m "Something terribly misguided"
$ git reset HEAD~
<< edit files as necessary >>
$ git add ...
$ git commit -c ORIG_HEAD
git mv old/submod new/submod
git branch temp # base new branch on detached head
git checkout master
git merge temp
git branch -d temp
Make an empty commit (good for debugging CI):
git commit --allow-empty -m "Empty commit to trigger post_receive hooks"
git submodule update --init --recursive
- Dangit, git! - "Git is hard: screwing up is easy, and figuring out how to fix your mistakes is nigh on impossible. Git documentation has this chicken and egg problem where you can't search for how to get yourself out of a mess, unless you already know the name of the thing you need to know about in order to fix your problem."
- Git housekeeping tutorial: clean-up outdated branches in local and remote repositories #article - “After working with branch per feature for a while any Git-repository becomes a mess of outdated and not finished branches. To deal with this issue, we need to clean-up three kinds of branches…”
- Quick Tip: Autocomplete Git Commands and Branch Names in Bash #article - “In bash in Mac OS X, you can use [TAB] to autocomplete file paths. Wouldn’t it be nice if you could do the same with git commands and branch names?”