Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I just did git init to initialize my folder as git repo and then added a remote repository using git remote add origin url .

(我只是使用git init将我的文件夹初始化为git repo,然后使用git remote add origin url添加了一个远程存储库。)

Now I want to remove this git remote add origin and add a new repository git remote add origin new-url .

(现在,我想删除此git remote add origin并添加一个新的存储库git remote add origin new-url 。)

How can I do it?

(我该怎么做?)

  ask by Om3ga translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
462 views
Welcome To Ask or Share your Answers For Others

1 Answer

Instead of removing and re-adding, you can do this:

(您可以执行以下操作,而不是删除并重新添加:)

git remote set-url origin git://new.url.here

See this question: Change the URI (URL) for a remote Git repository

(看到这个问题: 更改远程Git存储库的URI(URL))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...