Not detecting remotes if multiple URL's are set for the same remote.
git remote set-url --add --push origin [email protected]:username/repo
git remote set-url --add --push origin [email protected]:username/repo2
git remote -vorigin [email protected]:username/repo (fetch)
origin [email protected]:username/repo (push)
origin [email protected]:username/repo2 (push)
Note: No remote detected for branch. Cannot push because there is no remote named "origin" for which to create a remote tracking branch.
Expected behavior:
It should work the same as running the command:
git push
Which will push it to both just fine.
Actual behavior:
It doesn't allow me to push at all.
Reproduces how often:
100% of the time. Interestingly enough though, if I only add a second remote url after I have already loaded in the repo, it will continue to allow me to push - until i close and open atom or add the repo again (at which point it detects changes the error comes).
1.18.0-beta0
Interestingly I get the same error and behaviour if I add a single remote to my local repo, but I give it an alias other than 'origin'. For example:
git remote add gh https://github.com/myuser/myrepo.git
Attempting to push within Atom gives rise to:
Note: No remote detected for branch. Cannot push because there is no remote named "origin" for which to create a remote tracking branch.
Could be related.
I'm having this error message as well when using a remote other than origin.
Yeah, getting this as well on v1.19.2
Same challenge for me on 1.19.2. My remotes are not named origin.
still same problem, has this been fixed ?
Interestingly I get the same error and behaviour if I add a single remote to my local repo, but I give it an alias other than 'origin'. For example:
git remote add gh https://github.com/myuser/myrepo.gitAttempting to push within Atom gives rise to:
Note: No remote detected for branch. Cannot push because there is no remote named "origin" for which to create a remote tracking branch.
Could be related.
I was able to get around this for now. I had to set the upstream for the branch and that worked for me. I no longer get the error about no remote named "origin"
Example:
git push -u gh <branch>
Most helpful comment
still same problem, has this been fixed ?