Until recently, I have not been aware of --track
switch for git branch
. I read the documentation and tried this command, but it has no sense to me.
--track
When creating a new branch, set up
branch.<name>.remote
andbranch.<name>.merge
configuration entries to mark the start-point branch as "upstream" from the new branch. This configuration will tell git to show the relationship between the two branches ingit status
and gitbranch -v
. Furthermore, it directsgit pull
without arguments to pull from the upstream when the new branch is checked out.This behavior is the default when the start point is a remote-tracking branch. Set the branch.autoSetupMerge configuration variable to
false
if you wantgit checkout
andgit branch
to always behave as if --no-track were given. Set it toalways
if you want this behavior when the start-point is either a local or remote-tracking branch.
I can see that people relate to this switch when they want to make branch track upstream branch
What does it mean? Is it me or this switch description is confusing. When I use term upstream
, I refer to the another remote repo (fork) that I can push changes to.
What happens when I start tracking remote branch? How does it manifest locally?