Can i push into two remote repository in the same command line?

Luc*_*eck 1 git github gitlab

I want to push and syncronize my code in two different remote repository, to Gitlab and Github at the same command, is it possible?

cho*_*oba 5

Yes. Just define two remotes for your working copy:

git remote add lab https://gitlab.com/...
git remote add hub https://github.com/...
Run Code Online (Sandbox Code Playgroud)

Push takes a repository as a parameter:

git push lab master
git push hub master
Run Code Online (Sandbox Code Playgroud)

  • 对于单行`git push lab master; git push hub master` :) (2认同)