Git Setup a tracking branch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Setup upstream repository
git remote add upstream path-to-upstream
# Fetch upstream's branches
git fetch upstream
# List all branches
git list --all
# Setup a tracking branch
git checkout -b foo --track upstream/foo
# Or omit the `-b` argument
git checkout --track upstream/foo

Related Question: How to clone all remote branches with Git?

0%