Git更改远程仓库Url

  1. git remote remove origin
  2. git remote add origin [YOUR NEW .GIT URL]
  3. edit your .git/config
[branch "master"]
    remote = origin
    merge = refs/heads/master

Now you can simply git push and git pull.

  1. git branch -u origin/remote-branch-name local-branch-name

  2. git pull


总结

git branch -u 关联本地分支和远程分支。其中origin/remote-branch-name 是远程分支, local-branch-name是本地分支

你可能感兴趣的:(Git更改远程仓库Url)