为什么我总是要做‘-设置-向上’?我在Git创建了一个新的分支机构:git branch my_branch推它:git push origin my_branch现在假设有人在服务器上做了一些更改,我想从origin/my_branch..我知道:git pull但我明白:You asked me to pull without telling me which branch you
want to merge with, and 'branch.my_branch.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
If you often merge with the same branch, you may want to
use something like the following in your configuration file:
[branch "my_branch"]
remote = <nickname>
merge = <remote-ref>
[remote "<nickname>"]
url = <url>
fetch = <refspec>
See git-config(1) for details.我学到了我可以让它发挥作用:git branch --set-upstream my_branch origin/my_branch但是为什么我要为我创建的每一个分支都这样做呢?很明显如果我推my_branch进origin/my_branch,那我就想拉origin/my_branch进my_branch?如何使这成为默认行为?
3 回答
ITMISS
TA贡献1871条经验 获得超8个赞
git branch --set-upstream
1
git push -u origin my_branch
git push -u origin HEAD
-u
origin
git branch --set-upstream
git push
git pull
.
1
更新2012-10-11git branch --set-upstream-to
my_branch
:
git branch --set-upstream-to origin/my_branch
git branch -u origin/my_branch
我很想说 git branch --set-upstream origin/master
,但这告诉吉特要安排当地的分支机构。 origin/master
与当前签出的分支集成,这不太可能是用户的意思。不建议使用该选项;请使用新的 --set-upstream-to
(短而甜) -u
)选项。
- 3 回答
- 0 关注
- 417 浏览
添加回答
举报
0/150
提交
取消