Based on the other answers and the documentation, I understand that setting a remote tracking branch tells git where to pull from and where to push to. But am I not telling git that every time I perform git pull
?
For example with git pull origin master
I am telling git to pull from the remote named origin
and the branch master
on that remote. What is the use of having a remote tracking branch in this case?
I do know it determines which remote branch git status
reports that my current local branch is ahead of or behind.
I am aiming to create a setup where I am pulling from the original branch and pushing to its fork on my account. So far all I can think of is setting up 2 remotes. One to the original repository (upstream) and one to my fork (origin). Thus I can git pull upstream master
for pulling the lastest code and git push origin master
to push my modifications.
It doesn't seem like setting a remote tracking branch serves any real purpose.