"git push all"(多个存储库)不起作用

rip*_*234 1 git heroku

这个答案解释了如何同时推动多个回购.

  1. 我的.git/config包含:

    [remote "all"]
        url = git@github.com:commerce-sciences/scale-master.git
        url = git@heroku.ron:scale-master.git
    
    Run Code Online (Sandbox Code Playgroud)
  2. git push all 成功部署到heroku.

  3. 由于某些原因,似乎没有将更改推送到github.

> git push all
Everything up-to-date
Everything up-to-date

> git status
# On branch master
# Your branch is ahead of 'origin/master' by 22 commits.
#
nothing to commit (working directory clean)
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

pok*_*oke 5

您配置all远程存储库的方式根本没有链接到本地​​存储库中的现有存储库.所以第二个存储库allorigin它具有相同的URL不同.

当你全力以赴时,Git并不知道origin在这样做时它也会推动.因此,它无法更新本地存储库中的远程分支.

不幸的是,你无法改变这种行为.git push不支持远程存储库组git fetch.至少还没有.如果是这样,Git将具有从远程存储库(组)all到的显式链接,origin并且可以更新本地引用.

所以现在,你唯一的选择是在推送all,使用git fetch origin或仅git fetch(用于远程跟踪分支)后立即获取单个遥控器,或者明确地推送到它们开始.