我有这个奇怪的问题,每当我这样做git push
时都拒绝做任何事情:
fatal: The current branch master has multiple upstream branches, refusing to push.
当我这样做git push -u origin master
时似乎将其设置为跟踪分支:
Branch master set up to track remote branch master from origin.
但是下次我尝试git push
它再次拒绝这样做.我试图谷歌,但似乎问题是相当新的,我找不到任何解释这种行为.想法?
更新: ./git/config
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = gitosis@xxxx.xx:milk.git
[branch "master"]
remote = origin
merge = refs/heads/master
Run Code Online (Sandbox Code Playgroud)
UPDATE2:与解决git config remote.origin.push HEAD
下面一行出现在.git/config
以[remote "origin"]
节:
push = HEAD
Run Code Online (Sandbox Code Playgroud)
UPDATE3:
$ git branch -vv
billing 633c796 [origin/billing: behind 889] links
* master 1a0de50 [origin/master: ahead 1] more fixes
new_master 3b880d7 [origin/new_master] branches diverged
photo_stacks 29c8f0d [origin/photo_stacks] 1st try
responsive 1dad980 [origin/responsive] update
$ git push
fatal: The current branch master has multiple upstream branches, refusing to push.
Run Code Online (Sandbox Code Playgroud)
Pet*_*oes 111
您可能想要执行以下操作:
git config remote.origin.push HEAD
Run Code Online (Sandbox Code Playgroud)
在主分支上不带任何参数的推送可能会导致您的错误消息.我不确定这是否是一个回归问题,或者它是否总是如此.
mmu*_*lis 32
运行git config -l
并查看是否有多行包含branch.master*references可以复制[branch"master"]部分~/.gitconfig
并.git/config.
删除~/.gitconfig
固定多个上游分支检测的部分.
red*_*nzz 10
您必须指定要推送的分支.git push
会自动尝试推送本地分支正在跟踪的所有引用和标记.服务器上的在线分支可能已向前发展.因此,您可能会遇到这种情况.你应该简单地使用
git push origin master
Run Code Online (Sandbox Code Playgroud)
并且还要协调更改,git pull
这将使用服务器更新本地引用.
归档时间: |
|
查看次数: |
29747 次 |
最近记录: |