Reputation: 727
I have a GitHub repository that I push my data in it. I would like to add another remote repository to push my data at the same time.
For example;
git push origin master
git push {another origin} master
Anybody know if it is possible?
Upvotes: 6
Views: 16090
Reputation: 113485
You have to add another remote:
git remote add another-origin <url>
git push another-origin master
You can replace another-origin
with the remote name you want. Also, replace the <url>
with your remote url you want to add.
GitHub has a nice guide about this. About working with remotes in general, you can read more here.
Upvotes: 4
Reputation: 312259
You can add an additional remote using the following syntax:
git remote add remotename https://github.com/user/repo.git
You can then push to it (assuming you have the permissions) using:
git push remotename remotebranch
Upvotes: 13