0

Usually I start to work with new project from GIT this way:

git init
git remote add origin https://myurl.git
git clone

But what if I have entered wrong URL before git clone and now wont to clear it and add new one?

What is command that does that?

vico
  • 17,051
  • 45
  • 159
  • 315

1 Answers1

1

Use git remote set-url:

git remote set-url origin https://myurl.git
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
  • this means I can use it in future instead of 'git remote add origin' ? – vico Jun 25 '16 at 10:26
  • 2
    If you want to add it the first time use `git remote add origin`. If you want to change the URL of a remote you already defined, use `git remote set-url origin`. – Tim Biegeleisen Jun 25 '16 at 10:29