根據progit上的文檔操作的:http://git-scm.com/book/zh/v2/Git-%E4%B8%8E%E5%85%B6%E4%BB%96%E7%B3%BB%E7%BB%9F-%E8%BF%81%E7%A7%BB%E5%88%B0-Git遇到兩個問題:為了將標簽變為合適的 Git 標簽,運行 $ cp -Rf .git/refs/remotes/origin/tags/* .git/refs/tags/
$ rm -Rf .git/refs/remotes/origin/tags這會使原來在 remotes/origin/tags/ 里的遠程分支引用變成真正的(輕量)標簽。接下來,將 refs/remotes 下剩余的引用移動為本地分支:$ cp -Rf .git/refs/remotes/* .git/refs/heads/$ rm -Rf .git/refs/remotes.git/refs/remotes 現在所有的舊分支都是真正的 Git 分支,并且所有的舊標簽都是真正的 Git 標簽。最后一件要做的事情是,將你的新 Git 服務器添加為遠程倉庫并推送到上面。但是執行cp的時候發現這個目錄并不存在,git branch -r列出來很多原來的$git branch -r
origin/v1.1origin/tags/v1.1.2origin/tags/v1.1.2@438origin/tags/v1.2.1origin/tags/v1.2.1@474origin/tags/v1.2.3origin/trunk然而 .git/refs/remotes/origin/tags 下面并沒有文件參考http://nowing.iteye.com/blog/844608的做法,使用標準命令將branch轉成tags$ git tag tagname tags/tagname ----用指定的分支創建一個Git標簽
$ git branch -r -d tags/tagname ----刪除指定的遠程分支最后用git push origin --allpush到git服務器,但是只有主干,沒有分支用git push origin master --tags有主干和tags,但是也沒有分支最后的最后問題來了,怎么把分支也遷移上去?
- 0 回答
- 0 關注
- 867 瀏覽
添加回答
舉報
0/150
提交
取消