Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

fatal: No such remote 'origin' (after git remote set-url origin https://...)

robert kofler December 14, 2012

My code is already tracked by Git

If your code is already tracked by Git then add this repository as a new repository that you can push to.

I cd to /path/to/my/already_tracked/.git

git remote set-url origin https://user:server:port/scm/ABC/my_stash_repo.git

leads to:

fatal: No such remote 'origin'

also a "git remote -v " does not show the above stash-repo.

what is wrong in my thinking?


 

2 answers

1 accepted

70 votes
Answer accepted
Stefan Saasen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 15, 2012

The above will only work if you've either cloned the repository or manually added a remote called origin.

If "git remote -v" doesn't show you any remotes you can simply add a remote using:

git remote add origin https://username@stash/scm/PROJECT/repo.git

The name of the remote doesn't have to be "origin" and can be any name that makes it easier for you to identify that particular remote (e.g. "stash").

HTH,

Stefan

Destin Coleman July 15, 2019

Dude, 7 years later and you are still saving lives

Like # people like this
Daniel Russell September 18, 2019

Yeah. I don't get it. I'm pretty new to git and thoroughly frustrated and confused at this stage. But at any rate, I think this should work and doesnt. Here's my git remote -v: 

origin https://github.com/danielmrussell/Vulkan-Loader.git (fetch)
origin https://github.com/danielmrussell/Vulkan-Loader.git (push)
upstream https://github.com/KhronosGroup/Vulkan-Loader.git (fetch)
upstream https://github.com/KhronosGroup/Vulkan-Loader.git (push)


And weirdly, I somehow managed to submit a Pull Request from the extension finally, despite the fact that I am still getting flooded with these error messages:


[Info] Looking for git repository
[Info] Git repository found, initializing review manager and pr tree view.
[Info] Review> Validate state in progress
[Info] Review> Validating state...
[Info] No remote with name 'origin' found. Please update your 'githubPullRequests.remotes' setting.
[Info] No remote with name 'upstream' found. Please update your 'githubPullRequests.remotes' setting.
[Info] No remote with name 'origin' found. Please update your 'githubPullRequests.remotes' setting.
[Info] No remote with name 'upstream' found. Please update your 'githubPullRequests.remotes' setting.
[Info] No GitHub remotes found
[Info] No GitHub remotes found
[Info] Review> Queuing additional validate state
[Info] Review> Validating state...
[Info] No remote with name 'origin' found. Please update your 'githubPullRequests.remotes' setting.
[Info] No remote with name 'upstream' found. Please update your 'githubPullRequests.remotes' setting.
[Info] No GitHub remotes found
[Info] Review> Queuing additional validate state
[Info] Review> Validating state...
[Info] Found GitHub remote
[Info] https://api.github.com: GraphQL support detected
[Info] Review> current branch master is associated with pull request #250
[Info] Review> Resolving pull request
[Info] Review> Fetching pull request data
[Info] Review> register comments provider
[Info] Review> display pull request status bar indicator and refresh pull request tree view.



What gives?



Alex McDowell August 2, 2020

8 years later and you're still saving lives. Thank you so much!!!!!

Like Shawn Veltman likes this
15 votes
Nate Pendleton June 24, 2014

It would be nice if the Stash instructions on the new empty repo page mentioned this.

Michael Kotthaus April 7, 2017

Yes, I also noticed that the remote must be added, before you can specify an URL with set-url.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events