Quantcast
Channel: niemueller.de
Viewing all articles
Browse latest Browse all 10

Setup git tracking branch for existing branch (1 comment)

$
0
0
Something that I did many web searches is how to setup up tracking of a remote git branch for an existing local branch. That regularly happens for example if I start with a local topic branch, and then push it to the central repository. Now, git does neither automatically setup that this (new) remote branch should be tracked for the local branch nor did I find a convenient command or argument to do so. So here is what is required, assuming that the remote repository is named origin, the local branch is topicbr, and the remote branch is timn/topicbr, and you are in the local git repository:
git config branch.topicbr.remote origin
git config branch.topicbr.merge refs/heads/timn/topicbr
.
It's that easy and now I have a place to look it up next time I need it...

Viewing all articles
Browse latest Browse all 10

Trending Articles