Resources

Useful Settings

Auto-set remote on push:

git config --global --bool push.autoSetupRemote true

See push.autoSetupRemote.

Change a Specific Commit

git rebase -i <commit-hash>~   # Use --root instead if editing the initial commit
  1. In the editor, change pick to edit (or e) next to the commit you want to modify, then save and quit.
  2. Make your changes, stage them, and run git commit --amend.
  3. Finish with git rebase --continue.

Worktrees

git-worktree — check out multiple branches in separate directories from the same repository.