List |
List local branches |
git branch |
|
List local and remote branches |
git branch -a |
|
List remote branches only |
git branch -r |
Create |
Create a new branch |
git branch <new-branch-name> |
|
Switch to the new branch |
git checkout <new-branch-name> |
|
Create and switch to the new branch |
git checkout -b <new-branch-name> |
Push |
Push the new branch |
git push -u origin <new-branch-name> |
Status |
Current status of the commit |
git status |
Syncing |
Pull the repo from the remote source |
git pull |
|
Add a file to the commit |
git add <file> |
|
Prepare the commit with a message |
git commit -m "message" |
|
Push the commit to the repo |
git push |