[英]Replace B Git repo Master with another A Git repo master
我有 2 個 GIT 存儲庫。 比方說A和B。現在我需要用A的主人完全取代B主人。 我在B為空的時候也做過同樣的操作。 但現在我有代碼了。 那我現在該怎么做呢?
當 B 為空時,我這樣做了。
git remote set-url origin https://github.com/sam/B.git
git push -u origin master
假設您已經配置了遙控器:
git remote set-url origin https://github.com/sam/B.git
以下命令應該有效:
git push -f origin master:master
它用“當前”主分支( A
)覆蓋遠程主分支( B
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.