Can I push a local repo to two remote repos?

I want to use these bash functions to redirect my local repo to two remote repos, but I'm not sure if this will work.

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"
}
+4
source share
1 answer

Customize your remotes using:

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

Now you can use:

git push all master

to click on both repositories

+2
source

Source: https://habr.com/ru/post/1606071/


All Articles