My project is required to be placed at two different git repositories as per client's requirement. Is there any way using which I can do this through eclipse or command line? Thanks.
Asked
Active
Viewed 1,358 times
2
-
Possible duplicate of [pull/push from multiple remote locations](https://stackoverflow.com/questions/849308/pull-push-from-multiple-remote-locations) – phd Sep 14 '18 at 14:20
-
https://stackoverflow.com/search?q=%5Bgit%5D+push+to+two+remote+repositories – phd Sep 14 '18 at 14:20
1 Answers
5
You can add anothr remote to your actual one. So you would have an "origin" which is conventionally the name you use and an originClient
git remote add originClient git@github.com:User/UserRepo.git
git push -u originClient yourBranchName

Giova.panasiti
- 447
- 3
- 11
-
Thanks @Giova.panasiti for replying. I'm not sure if I understood you completely. Can you please elaborate more? – Richa Sharma Sep 14 '18 at 12:23
-
1I'll try to make myself more clear. You can have multiple url (github, gitlab etc) on the same repository. When you add a url you usually add it as 'remote' in git. (Ex: git remote add origin) and we all call it origin as a standard but you can have multiple URLs on the same git project and just pushing the commits to the remote you prefer. – Giova.panasiti Sep 14 '18 at 13:36