This is a draft cheat sheet. It is a work in progress and is not finished yet.
Restore working tree files
View commands of HEAD changes on branch
|
|
Mannage branches on the repo (git branch)
git branch
# List all remote branches
git branch -r
# Rename current branch
git branch -m new-name
# Rename a specific branch
git branch -m old-name new-name
# If already pushed, update remote
git push origin -u new-name
git push origin --delete old-name
|
If a branch gets renamed locally, this name change will not be reflected on the remote. One will need to change this.
|
|
git fetch
git fetch downloads commits, branches, and tags from a remote repository into your local repo — but does not modify your working directory or current branch.
|