Git Workflow
- Status:
git status,git diff,git log --oneline --graph - Branch:
git switch -c feature/x; back to maingit switch main - Commit: keep small and meaningful; stage in pieces
git add -p - Stay current:
git fetchthengit rebase origin/main(linear history) - Conflict: fix the file ->
git add <file>->git rebase --continue - Undo: amend last commit
git commit --amend; revert a changegit revert <sha> - Stash:
git stash push -m "msg", restoregit stash pop