RSS

Git: make an existing local branch track a remote branch

03 Feb

If a branch is not created, it is well know to use below command:

git checkout –track –b SomeBranch remote/SomeBranch

However if you have ever created a local branch using

git branch SomeBranch

You can use below command to hook the local with the remote branch

git branch  –set-upstream SomeBranch remote/SomeBranch

 
1 Comment

Posted by on February 3, 2012 in General

 

One response to “Git: make an existing local branch track a remote branch

  1. xinyustudio

    October 28, 2012 at 12:16 am

    or another command:
    $ git push -u origin SomeBranch

    here -u= upstream.

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: