Github倉庫重命名


1.在Github上重命名倉庫

跑到自己的倉庫那,找到 Settingtag , 點進去后 OptionsSettings 就可以設定 Repository name.

2.修改本地倉庫信息

因為遠程的倉庫名改了, 本地的對應倉庫名也要改.

1.檢查當前遠程倉庫的信息
$ git remote -v 

列出所有遠程倉庫信息, 包括網址.

2.修改本地對應的遠程倉庫的地址

修改完后使用 git remote -v 檢查一下本地是否修改成功

$ git remote set-url origin git@github.com:username/newrepo.git
3.拉取最新的倉庫
$ git pull

拉取完整的遠程倉庫,這一步是為了避免提交代碼的時候出錯,執行這一步的時候可能會有以下提示:

* [new branch]      master     -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master

如果遇到這個提示可以直接使用下面這個命令:

git branch --set-upstream-to=origin/master

現在你可以再次愉快的使用git了 O(∩_∩)O~~

END!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM