1

I came across a way to push to multiple repositories at the same time, enter image description here

Here is what I am trying to do,

$ git remote set-url --add --push origin https://github.com/FahadUddin92/Multiple-Push.git 

I am getting the below error,

fatal: No such remote 'origin' 
5
  • git remote add origin http://your_url ? Commented Nov 23, 2017 at 16:15
  • @Protectator: That would just add a single repository to push to. I need multiple repositories. Commented Nov 23, 2017 at 16:16
  • Yeah, but I mean isn't it required to first add the remote that way and only then set multiple URLs ? Commented Nov 23, 2017 at 16:17
  • @Protectator: Yes you are right. Can you please post that as an answer? Commented Nov 23, 2017 at 16:25
  • If someone's coming across this problem, here is a tutorial I wrote to push to multiple repositories at once. Commented Nov 23, 2017 at 16:48

1 Answer 1

4

The error message tells that there's currently no remote named origin. You're trying to add an url to an existing remote, so you'll need to create it first.

Taking your example, to make it work you'll first need to create the remote using git remote add :

git remote add origin [email protected]:USERNAME/REPO-1.git 

And only then, add the second url to that created remote :

git remote set-url --add --push origin [email protected]:USERNAME/REPO-2.git 
Sign up to request clarification or add additional context in comments.

Comments