0
点赞
收藏
分享

微信扫一扫

How to switch repositories from one to the next


You can use git remote to manage your remote

  • rename origin

git remote rename origin old_origin


  • add a new origin

git remote add origin git://github.com/my/forked/repo.git
    git fetch origin # will create all the remote branches references 
                     # in your local repo


 

git branch --set-upstream master origin/master

The "nothing to commit (working directory clean)" message of git status won't prevent you to push.
After changing the origin, you should see:

$ git status
# On branch master# Your branch is ahead of 'origin/master' by xxx commits.#
nothing to commit (working directory clean)

That means you have some commits to push to your new origin.

 

 


 

 

举报

相关推荐

0 条评论