我正在将Git子树与正在处理的几个项目一起使用,以便在它们之间共享一些基本代码。基本代码会经常更新,并且升级可以在任何项目中进行,最终所有项目都将进行更新。
我遇到了一个问题,其中git报告我的子树是最新的,但是推送被拒绝了。例如:
#! git subtree pull --prefix=public/shared project-shared master
From github.com:****
* branch master -> FETCH_HEAD
Already up-to-date.
如果我推送,我会收到一条消息,说没有任何推送...对吗?对?:(
#! git subtree push --prefix=public/shared project-shared master
git push using: project-shared master
To git@github.com:***
! [rejected] 72a6157733c4e0bf22f72b443e4ad3be0bc555ce -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:***'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
这可能是什么原因?为什么推动失败?