Git: rewriting and rescuing history
Rewrite history without fear of breaking it: rebase, searching history, bisect and rescuing lost commits.
- Set up a git aliaseasy
- Fix the last commit's messageeasy
- Undo a bad commit with revertmedium
- Annotated tag on the right commitmedium
- Export an author's commits to a fileeasy
- Pull a value out of historymedium
- Find the commit that added a linemedium
- Transfer a single commit with cherry-pickmedium
- Transplant commits with rebase --ontohard
- Squash a fixup commit via autosquashhard
- Add a line to an old commit with rebase edithard
- Reorder commits with rebasehard
- Drop an unwanted commit with rebasehard
- merge or rebaseinterview questionmedium
- Recover a lost commit via refloghard
- Rescue a commit from detached HEADmedium
- Find the first bad commithard
- Find the breaking commit with bisect runhard
- Add a working tree for a branchmedium
- Keep only one directory in the working treemedium
- Exclude a directory from git archivemedium
- Clean out only the ignored junkmedium