https://git-scm.com/book/id/v2/Git-Branching-Remote-Branches
Checkout to your local branch or create/checkout a new branch
# example: create/checkout a new branch called 'map'
git checkout -b map
Push local new-branch to origin(Github) as a remote branch.
'-u' option sets up the upstream tracking.
# git push -u <remote-server> <new-branch>
git push -u origin map
https://git-scm.com/book/id/v2/Git-Branching-Remote-Branches
# git push <remote-server> --delete <branch-name>
git push origin --delete map
# or
# git push <remote-server> :<branch-name>
git push origin :map
https://git-scm.com/book/id/v2/Git-Branching-Remote-Branches
Download all branches
git checkout master
git fetch
View all branches
git branch -a
Checkout local copy of remote branch
git checkout <branch-name>
OR if there are other remotes (instead of just 'origin')
# git checkout-b <new-branch-name> <remote/branch-name>
git checkout -b map origin/map # Branch 'map' set up to track remote branch 'map' from origin.
# switched to a new branch 'serverfix'
Be sure local master branch has the latest commits (git pull)
# from your master branch
git checkout master
git pull
checkout to local feature branch (example: map)
git checkout map
bring over missing master commits into the 'map' branch
git rebase master
Extra: from here we can merge feature branch to local master branch
# switch back to master branch
git checkout master
# merge feature branch to master
git merge map
Checkout to master branch
git checkout master
Fetch commits and then rebase
git fetch
git rebase
Checkout to feature branch
git checkout assemblies
Fetch commits and then rebase
git fetch
git rebase
or
git pull --rebase
https://help.github.com/articles/syncing-a-fork/
# First add the upstream repo (the original repo)
git remote add upstream <git-repo>
# Get all the latest commits from upstream to local
git fetch upstream
# After fetching, merge master tracking-branch with local master branch
git checkout master
git merge upstream/master
# Push to YOUR forked repo location
# Removes ALL cached files
$ git rm -r --cached .
$ git add .
$ git commit -m "Clean up ignored files"