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
• 36,040 points
504 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
• 78,520 points

Related Questions In Git & GitHub

0 votes
3 answers

difference between git remote and git clone

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

answered Jul 10 in Git & GitHub by anonymous
4,505 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
• 11,270 points
685 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
759 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
• 19,570 points

closed Nov 25, 2019 by Sirajul 218 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
813 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 17 in Git & GitHub by anonymous
826 views