- Git branch -av: list all local and remote branches, v here is for verbose
- git checkout <branchname>: switch branch
- git checkout -b <branchname> - git branch <newbranchname>: create a new branch
- git branch -d <branchname> - git tag <tagname> - git push --tags
- git remote -v
- git pull <origin><branch>: get changes and merge into HEAD
- git push <origin><branch>: publish local changes on a remote
- git branch -dr <remote/branch>
Undo
git reset: reset staging area
git reset --hard: reset staging area and working directory
git reset <commit id>
git reset <--hard|--soft> HEAD~1
--hard: won't keep local changes
--soft: will keep local changes
Merge & Rebase
git merge <branch name>: merge <branch> into current branch
git rebase <branch name>: Rebase your current HEAD onto <branch>
git rebase --continue: continue rebase after conflict resolution