【发布时间】:2015-12-26 13:03:41
【问题描述】:
- github 中的 git 存储库包含以下分支 (master,'abc')
- 克隆 git repo abc 分支到本地机器
- 使用 git bash 进入 repo 文件夹
- 创建名为
bbb的git分支 - 结账到分行
bbb - 将文件添加到 repo 文件夹
- 提交更改
-
将更改推送到远程仓库
abc分支 使用了这个命令:git push origin bbb:abc效果很好。
-
然后将更改推送到远程 repo master 分支 使用了这个命令:
git push origin bbb:master
然后出现以下错误信息:
! [rejected] bbb -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/sw7x/testing4.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
谁能解释为什么会这样?
【问题讨论】:
-
在您的克隆和推送期间是否有人推送了更改?
-
如果你想强推,试试
push -f