开发者

switching remotes in github

Can we switch to different remotes in github I have two remotes

upstream (main repo) origin (mywork)

Accidently, i created clone of upstream and created branches and worked in it. I want to miove all changes ma开发者_如何学Gode to upstream's test branch to origin and also switch to origin. Now when ever I create a branch it is created in origin

Please suggest.


Considering those are the same repo (or at least repos with a common history), you can:

  • clone the other GitHub repo 'origin' 'mywork'on your computer
  • add the first repo (the 'upstream' cloned one locally) as a remote (git add remote upstream file:///path/to/main/repo)
  • fetch everything and create local branches out of the remote branches
  • push everything back to your origin 'mywork' repo
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜