我克隆了一个远程代表,主,并做了一些更改。在推送更改之前,管理员已经创建了开发分支。
现在,"git远程显示原点“命令显示了下面的模糊头分支。
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)
我已经对克隆的主进行了更改。现在,如何将更改推送到新创建的开发分支?
谢谢
发布于 2016-02-08 08:36:01
如果希望将名为development
的本地分支“链接”到远程development
分支,则从当前状态(例如:具有额外提交的master
分支)运行:
# create a new branch on the current commit, and switch to it :
$ git checkout -b development
# push your moidifcations to the remote "development" branch,
# and tag your local branch to follow the remote "development" branch :
$ git push --set-upstream origin development
如果您想要推送到任何远程分支:
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
https://stackoverflow.com/questions/35264528
复制相似问题