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 in Git & GitHub by kartik
• 15,480 points
158 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 by Niroj
• 32,280 points

Related Questions In Git & GitHub

0 votes
2 answers

difference between git remote and git clone

git remote add just creates an entry in ...READ MORE

answered Aug 7, 2018 in Git & GitHub by Kalgi
• 51,890 points
2,864 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 2, 2019 in Git & GitHub by Ali
• 10,670 points
336 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
209 views
0 votes
0 answers

Difference between git rebase and git merge? Which among them is better to use?

Difference between git rebase and git merge? ...READ MORE

Nov 25, 2019 in Git & GitHub by anonymous
• 10,310 points

closed Nov 25, 2019 by Sirajul 147 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
533 views
0 votes
1 answer
0 votes
1 answer

What is the difference between git fetch and git pull?

Hii @kartik, The main difference between git fetch ...READ MORE

answered Mar 3 in Git & GitHub by Niroj
• 32,280 points
230 views