git fetch
this will update all your local versions of the remote branches
git checkout [branch-name]
to change to the branch you want to be on
If you have no new commits and want to make the branch up to date with the remote
Warning! this will overwrite all changes/un-synced commits you have
git reset --hard origin/[branch-name]
If you have new commits and need to rebase
git rebase origin/[branch-you-want-to-rebase-with]
To push your changes to the remote
git push origin [branch-name]
If you have rebased your branch and the history is now different to the remote you will need to force-push
git push origin [branch-name] -f
after staging your changes to commit you will need to commit
commit with a description
git commit (this will bring up your editor vim/sublime/...)
one line commit
git commit -m "your commit message"
could be useful to have the command to change the editor, i.e.: