码迷,mamicode.com
首页 > 其他好文 > 详细

git将本地已经存在的分支和一个指定的远端分支建立映射关系

时间:2015-08-14 18:59:34      阅读:525      评论:0      收藏:0      [点我收藏+]

标签:

Make an existing Git branch track a remote branch?

Given a branch foo and a remote upstream:

As of Git 1.8.0:

git branch -u upstream/foo

Or, if local branch foo is not the current branch:

git branch -u upstream/foo foo

Or, if you like to type longer commands, these are equivalent to the above two:

git branch --set-upstream-to=upstream/foo

git branch --set-upstream-to=upstream/foo foo

As of Git 1.7.0:

git branch --set-upstream foo upstream/foo

Notes:

All of the above commands will cause local branch foo to track remote branch foo from remote upstream. The old (1.7.x) syntax is deprecated in favor of the new (1.8+) syntax. The new syntax is intended to be more intuitive and easier to remember.

 

git将本地已经存在的分支和一个指定的远端分支建立映射关系

标签:

原文地址:http://www.cnblogs.com/chucklu/p/4730745.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!