Git Tips and Tricks
Useful Git commands and patterns.
Useful Commands
# View recent commits
git log --oneline -10
# Undo last commit
git reset --soft HEAD~1
# Stash changes
git stash
git stash pop
Branching Strategy
- Create a new branch for each feature
- Merge back to main when ready
- Delete old branches
Common Issues
- Merge conflicts: Always communicate with your team
- Lost commits: Use
git reflogto recover