簡體   English   中英

如何通過命令行重命名 git branch: gh-pages 上的存儲庫?

[英]How to rename a repo that is on git branch: gh-pages through the command-line?

我已經閱讀了刪除和重命名遙控器的 Git 文檔,該解決方案是“$ git remote rename pb paul $ git remote origin paul”( https://git-scm.com/book/en/v2/Git-Basics- Working-with-Remotes ) 但我相信它適用於僅在 master 上的 repo。 有任何想法嗎? 我一直在嘗試使用上面的解決方案,但沒有重命名 repo。

您可以使用以下命令重命名遙控器:

$ git remote rename <current name> <new name>

您可以使用以下方法刪除它:

$ git remote rm <remote to remove>

遠程包含或跟蹤哪些分支並不重要。

重命名本地分支:

git branch -m <new_name> 

刪除舊的遠程分支

git push --delete origin <old_name>

推送新的遠程分支

git push origin <new_name>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM