2013年3月21日 星期四

git svn tag 轉換成真實的 tag

通常使用 git-svn 抓取 svn 的時候會下這樣的指令:

git svn clone https://remote.server/svn/ -s response

這樣可以把 svn 轉換成 git 匯入,但是 svn 的 tag 並沒有轉換成 git 的版本

接下來只要抓下的目錄下再輸入以下的指令就可以轉換成 git 使用的 tag

git for-each-ref refs/remotes/tags \
--shell --format="r=%(refname:short) t=\${r#tags/}" | \
while read e ; do eval "$e"; \
git tag -f $t refs/remotes/$r; \
git branch -d -r $r; \
done

相關文章:

git fetch 遇到的怪問題


在使用 git-svn-fetch 的時候 系統竟然吐出這樣的 log

fatal: Cannot open '.git/9YHRNPjFMp': Resource temporarily unavailable
hash-object -w --stdin-paths --no-filters: command returned error: 128

error closing pipe: Bad file descriptor at /usr/local/Cellar/git/1.8.2/libexec/git-core/git-svn line 0
error closing pipe: Bad file descriptor at /usr/local/Cellar/git/1.8.2/libexec/git-core/git-svn line 0

同樣的來源在不同的電腦上跑就可以正常 fetch ,後來發現是直接在虛擬碟 (nas) 上使用的關係

只要在實體硬碟上 fetch 就能正常運作了

相關文章: