How do I change the remote source of my github repo?

吃可爱长大的小学妹 提交于 2019-12-08 08:37:21

问题


I forked a repo and set everything up on my local machine. However, when I do 'git remote -v' it shows the original repo as my fetch and push source. I want it to by from my forked repo. How do I change it over to that without starting all over? And then, how do I add an upstream to the original repo?


回答1:


From the git remote man page:

 git remote set-url origin https://github.com/user/forkname
 git remote add upstream https://github.com/maintainer/reponame

See also the examples of GitHub: Changing a remote's URL.

set-url

Changes URL remote points to.

You will then be able to fetch from upstream, and push to origin:
See "What is the difference between origin and upstream in Github".



来源:https://stackoverflow.com/questions/13016696/how-do-i-change-the-remote-source-of-my-github-repo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!