咕泡计算机网络原理及应用\/--》ccys1473
在 A
之前就拿到了中心仓库的代码,在 A push
成功之后也对 f
文件进行了修改。这个时候 B
也运行 push
命令推送代码。
会收到一个类似下面的信息:
chenshu@sloop2:~/work/189/appengine$ git pushTo ssh://csfreebird@10.112.18.189:29418/appengine.git ! [rejected] master -> master (non-fast-forward)error: failed to push some refs to 'ssh://csfreebird@10.112.18.189:29418/appengine.git'To prevent you from losing history, non-fast-forward updates were rejectedMerge the remote changes (e.g. 'git pull') before pushing again. See the'Note about fast-forwards' section of 'git push --help' for details.
提醒你非快进方式的更新被拒绝了,需要先从中心仓库pull
到最新版本,merge
后再 push
.
fast forward
能够保证不会强制覆盖别人的代码,确保了多人协同开发。尽量不要使用 non fast forward
方法提交代码。