- Rebase
- Merge
- Pull teammate branch
For when you want move your branch's commits to the tip of master
.
One-liner
Run this while on your feature branch:
git pull --rebase origin master
Alternate commands
Does the same thing in 2 lines:
git fetch origin master
git rebase origin master
Does the same thing in 4 lines, but it also updates your master
branch for the next time you create a new branch
git checkout master
git pull origin master
git checkout -
git rebase master
For when you want get the latest master branch changes in one merge commit.
One-liner
Run this while on your feature branch
git pull origin master
Alternate commands
Does the same thing in 2 lines:
git fetch origin master
git merge origin master
Does the same thing in 4 lines, but it also updates your master
branch for the next time you create a new branch
git checkout master
git pull origin master
git checkout -
git merge master
For pulling your teammate's branch for the first time:
Two-liner
git fetch origin branchName
git checkout branchName
## If you are using multiple remotes, use this checkout command instead
git checkout -t origin/branchName
If you previously checked out their branch and need to update it:
git pull origin branchName