我有一个“被跟踪”的分支,我拉不出来。
所以我现在在“bucket-4”中:
$ git branch -v
bucket-1 410f7b5 * gh-53 * gh-48 * "Share App"
bucket-2 7ed70a2 * upgrade to SOLR 3.3.0
bucket-3 400ffe4 * emergency fix prod issue
* bucket-4 64c2414 Merge branch 'bucket-3' into bucket-4
master 8dc4854 [ahead 1] * gh-73
我想从我的遥控器获取更改:
$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.bucket-4.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 "bucket-4"]
remote = <nickname>
merge = <remote-ref>
[remote "<nickname>"]
url = <url>
fetch = <refspec>
See git-config(1) for details.
嗯,奇怪的是,我以为我已经添加了"bucket-4“作为跟踪分支。让我们看看:
$ git remote show origin
* remote origin
Fetch URL: git@github.com:abcd/main.git
Push URL: git@github.com:abcd/main.git
HEAD branch (remote HEAD is ambiguous, may be one of the following):
bucket-3
master
Remote branches:
bucket-1 tracked
bucket-2 tracked
bucket-3 tracked
bucket-4 tracked
master tracked
Local branches configured for 'git pull':
bucket-1 merges with remote bucket-1
bucket-2 merges with remote bucket-2
bucket-3 merges with remote bucket-3
master merges with remote master
Local refs configured for 'git push':
bucket-1 pushes to bucket-1 (up to date)
bucket-2 pushes to bucket-2 (up to date)
bucket-3 pushes to bucket-3 (up to date)
bucket-4 pushes to bucket-4 (local out of date)
master pushes to master (fast-forwardable)
实际上,bucket-4被标记为"tracked",但不知何故它被配置为push,而不是pull。
查看我的.git/config
文件,我看到我的大多数分支都有"remote“和"merge”条目,但不是bucket-4。如果没有这个,它怎么会被认为是“被跟踪的”呢?
[remote "origin"]
url = git@github.com:abcd/main.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[branch "rel-2011-07-07"]
remote = origin
merge = refs/heads/rel-2011-07-07
[branch "bucket-1"]
remote = origin
merge = refs/heads/bucket-1
[branch "bucket-2"]
remote = origin
merge = refs/heads/bucket-2
[branch]
autosetupmerge = true
[branch "bucket-3"]
remote = origin
merge = refs/heads/bucket-3
我看到这里可能的解决方案是在我的配置文件中添加remote/merge
-4的存储桶条目。但是,如果没有这个,它怎么被认为是“被跟踪的”呢?bucket-4是在本地创建的,然后从该存储库推送到服务器,因此我怀疑不知何故没有为该分支正确设置跟踪。
是否有一些配置我可以添加,以便让所有本地分支在将来正确地跟踪它们的远程?
https://stackoverflow.com/questions/7388278
复制相似问题