Resources
- Git flight rules
- Never use git submodules
- You Should Squash Merge to main
- How I configure my Git identities
- Commit Often, Perfect Later, Publish Once: Git Best Practices
Useful Settings
Auto-set remote on push:
git config --global --bool push.autoSetupRemote trueSee push.autoSetupRemote.
Change a Specific Commit
git rebase -i <commit-hash>~ # Use --root instead if editing the initial commit- In the editor, change
picktoedit(ore) next to the commit you want to modify, then save and quit. - Make your changes, stage them, and run
git commit --amend. - Finish with
git rebase --continue.
Worktrees
git-worktree — check out multiple branches in separate directories from the same repository.