我在我的项目中使用 Ant 构建脚本来创建一个名为“发布”的构建目录一旦我运行构建并使用我添加的新构建更新我的发布文件夹,然后提交并最终将其推送到我在 github 上的远程仓库。
将发布文件夹添加到项目后,我在本地计算机上运行 Yeoman 建议的此命令。
git subtree push --prefix publish origin deployment
在初始执行时,它会将我的发布文件夹部署到它自己的名为“deployment”的分支。</p>
每当我再次运行构建、添加文件、提交文件并将文件推送到远程仓库,然后在本地再次运行该子树命令时,我都会被拒绝。
! [rejected] 22cd5e0605fcc771615bdacbde9bd95582705c17 -> deployment (fetch first)
error: failed to push some refs to 'git@github.com:[org]/[repo].git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first merge the remote changes (e.g.,
hint: 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
这种工作流程的最佳方法是什么?