It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

59 votes
Answer accepted

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

Dude, 7 years later and you are still saving lives

Like # people like this

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?



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

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
Community showcase
Published in Training & Certification

Limited Time Only—Get Early Bird Pricing on Training & Certification at Atlassian Summit 2020

Summit 2020 is one of your best opportunities to get trained—or certified—in Atlassian products. You'll be in an exciting atmosphere, surrounded by Atlassian experts who are all eager to help ea...

303 views 4 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you