我将 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.
这可能是什么原因?为什么推送失败?