Check out a new branch tracking a remote branch
suggest changeThere are three ways of creating a new branch feature which tracks the remote branch origin/feature:
git checkout --track -b feature origin/feature,git checkout -t origin/feature,git checkout feature- assuming that there is no localfeaturebranch and there is only one remote with thefeaturebranch.
To set upstream to track the remote branch - type:
git branch --set-upstream-to=<remote>/<branch> <branch>git branch -u <remote>/<branch> <branch>
where:
<remote>can be:origin,developor the one created by user,<branch>is user’s branch to track on remote.
To verify which remote branches your local branches are tracking:
git branch -vv
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents