0-readme edit
git-cheatsheet edit
Git command cheatsheet
Name | Examples |
---|---|
git status
|
See what files have been changed |
git branch
|
View all branches |
git checkout -b branchName
|
Create and switch to new branch |
git branch -d branchName
|
Delete branch that has been merged |
git branch -D branchName
|
Delete branch that has not been merged |
git pull origin branchName
|
Pull updates from server |
git push origin branchName
|
Push updates to server |
git revert commit-id-to-revert
|
Revert to certain commit |
git branch --merged branchName
|
List branches that have been merged into branchName |
git branch --merged
|
List branches merged into HEAD (i.e. tip of current branch) |
git branch --no-merged
|
List branches that have not been merged. |
git cherry-pick commitSHA
|
Merge a single commit from another branch |