1
如何使用git svn客户端从原始的shell脚本获取最新的svn标记。如何使用git svn通过shell脚本获取SVN的最新标记
基本上想自动从远程SVN获取最新标签并与本地git仓库同步。因此,我使用“git svn”并希望引入hudson/jenkins作业来执行此步骤。
在此先感谢
如何使用git svn客户端从原始的shell脚本获取最新的svn标记。如何使用git svn通过shell脚本获取SVN的最新标记
基本上想自动从远程SVN获取最新标签并与本地git仓库同步。因此,我使用“git svn”并希望引入hudson/jenkins作业来执行此步骤。
在此先感谢
转换svn的标签Git标签,然后通常使用它们作为你。
# Loop on all the remote tags
git-for-each-ref refs/remotes/origin/tags | cut -d/-f 5- | while read ref
do
# Attach the tag to the desired commit
git tag -a "$ref" -m"say farewell to SVN" "refs/remotes/origin/tags/$ref"
# remove the old reference
git push origin ":refs/heads/tags/$ref"
# push it to your remote so your jenkins can use it
git push origin tag "$ref"
done
你也可以阅读它在这里也:
https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git
谢谢,还没有尝试过,但似乎是一个很好的解决方案 – enthuguy