tracking branch is nothing but a way to save us some typing.
If we track a branch, we do not have to always type git push origin <branch-name>
or git pull origin <branch-name>
or git fetch origin <branch-name>
or git merge origin <branch-name>
. given we named our remote origin
, we can just use git push
, git pull
, git fetch
,git merge
, respectively.
We track a branch when we:
git clone
git push -u origin <branch-name>
. This -u
make it a tracking branch.git branch -u origin/branch_name branch_name