What is the difference between remote add origin vs remote set-url origin in git

0 votes

HIIi team,

I wanted to know what is the difference between remote add origin vs remote set-url origin in git

What is difference between using following commands ? :

git remote add origin git@github.com:niroj/Repo.git
git remote set-url origin git@github.com:niroj/Repo.git

Thanks in advance!!

May 27, 2020 in Git & GitHub by kartik
• 37,510 points
2,010 views

1 answer to this question.

0 votes

Hello,

If you want to add a new remote, use the git remote add command on the terminal, in the directory your repository is stored at.

The git remote set-url command changes an existing remote repository URL.

So, remote add is to add a new one, remote set-url is to update an existing one

Hope this helps!!

answered May 27, 2020 by Niroj
• 82,780 points

Related Questions In Git & GitHub

0 votes
0 answers

git - remote add origin vs remote set-url origin

I created a new repo: git init echo "# ...READ MORE

May 13 in Git & GitHub by Kichu
• 19,040 points
257 views
0 votes
3 answers

difference between git remote and git clone

HI.... GIT REMOTE add just creates an entry in ...READ MORE

answered Jul 11, 2020 in Git & GitHub by anonymous
12,285 views
0 votes
1 answer
0 votes
2 answers

What's the difference between git push and git commit?

I installed ubuntu on vagrant and gave ...READ MORE

answered Jan 3, 2019 in Git & GitHub by Ali
• 11,340 points
2,128 views
0 votes
1 answer

How to add a remote git repository in Jenkins

Follow these steps: Step 1 Go to Manage ...READ MORE

answered May 23, 2019 in Git & GitHub by Alok
7,395 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
1,887 views
+2 votes
1 answer
0 votes
2 answers

What is the difference between git fetch and git pull?

Hii.. I HOPE BELOW ANSWER  MAY HELP YOU- In ...READ MORE

answered Jul 18, 2020 in Git & GitHub by anonymous
5,281 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP