git:远程头不明确-如何将更改推送到克隆分支以外的另一个分支?
我克隆了一个远程代表,master,并做了一些更改。在推动更改之前,管理员已经创建了开发分支 现在“git remote show origin”命令显示以下不明确的头分支git:远程头不明确-如何将更改推送到克隆分支以外的另一个分支?,git,branch,clone,Git,Branch,Clone,我克隆了一个远程代表,master,并做了一些更改。在推动更改之前,管理员已经创建了开发分支 现在“git remote show origin”命令显示以下不明确的头分支 HEAD branch (remote HEAD is ambiguous, may be one of the following): development master Remote branches: development new (next fetch will store in
HEAD branch (remote HEAD is ambiguous, may be one of the following):
development
master
Remote branches:
development new (next fetch will store in remotes/origin)
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local ref configured for 'git push':
master pushes to master (up to date)
我已经对克隆的主机进行了更改。现在,如何将更改推送到新创建的开发分支
谢谢如果您想让名为
开发
的本地分支从您当前的状态(例如:您的主
分支有额外提交)链接到远程开发
分支,请运行:
如果要推送到任何远程分支:
git push origin mylocalbranch:remotebranch
# for example :
git push origin master:development
# if you add '-u' or '--set-upstream', your local branch will
# follow the remote branch :
git push -u origin mylocalbranch:remotebranch
如果要将名为
开发
的本地分支“链接”到远程开发
分支,请从您的当前状态(例如:您的主
分支和额外提交)运行:
如果要推送到任何远程分支:
git push origin mylocalbranch:remotebranch
# for example :
git push origin master:development
# if you add '-u' or '--set-upstream', your local branch will
# follow the remote branch :
git push -u origin mylocalbranch:remotebranch
您使用的是什么版本的Git?此问题已在Git 1.8.4.3中更正。看见如果可能的话,您应该更新您的Git安装。@Jubobs(和@Chandu):请注意,本地和远程都必须足够新(1.8.4.3或更高版本),以便他们可以使用新消息正确识别头部。您使用的Git版本是什么?此问题已在Git 1.8.4.3中更正。看见如果可能的话,您应该更新Git安装。@Jubobs(和@Chandu):请注意,本地和远程都必须足够新(1.8.4.3或更高版本),以便他们可以使用新消息正确识别头部。