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://...)

Robert Kofler Dec 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

47 votes
Answer accepted
Stefan Saasen Atlassian Team Dec 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

14 votes
Nate Pendleton Jun 24, 2014

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

Michael Kotthaus Apr 07, 2017

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

Like Dhinesh Sivakumaran likes this

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase

Friday Fun: What's your best vacation planning hack?

Let's face it, work can be challenging but fulfilling, especially when you enjoy the challenges thrown at you.  However for me, nothing compares to going on vacation (or holiday as some of you m...

466 views 26 4
Join discussion

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