Git 我可以将本地回购推送到两个远程回购吗?

Git 我可以将本地回购推送到两个远程回购吗?,git,bash,heroku,Git,Bash,Heroku,我想使用这些bash函数将本地repo推送到两个远程repo,但我不确定这是否可行 p_foo_0() { git add -A . git commit -m "test" git push origin master echo "success" } p_foo_1() { git add -A . git commit -m "test" git push heroku master echo "success" } 使用以下命令配置远程设备: git

我想使用这些bash函数将本地repo推送到两个远程repo,但我不确定这是否可行

p_foo_0() {
  git add -A .
  git commit -m "test"
  git push origin master
  echo "success"
}

p_foo_1() {
  git add -A .
  git commit -m "test"
  git push heroku master
  echo "success"
}

使用以下命令配置远程设备:

git remote set-url all --push --add <first-repo>
git remote set-url all --push --add <second-repo>

推动两种回购协议

这里有一种方法——这是一种旧的方法,它也包含了一个与上面类似的更新答案-
git push all master