今天从GL挖来惊喜:
步骤:
1. cd $git-workdir
$git-workdir就是你本地的git目录,注意branch要在master,我只同步到trunck.说白了只同步,不使用SVN
2.git svn init --username=$username https://remote-testbed.googlecode.com/svn/trunk/$git-workdir
3.git svn fetch
r11 = 37275f86ebaa13616554dc5ddbeb1112d6e897f3 (git-svn)
我这里还出worning,没办法等。。。。
4.git branch svn/master master
5.在当前目录跑这个叫本就可以。
#!/bin/sh
HEAD="$(git symbolic-ref HEAD)" || exit 1
die()
{
echo "git-svn-update: $*"
exit 1
}
git svn fetch || die "failed to fetch SVN changes"
git branch -f svn/tmp master || die "failed to update/create temporary working branch"
git rebase --onto git-svn svn/master svn/tmp || die "failed to rebase on top of git svn branch"
git svn dcommit || die "failed to update SVN repository"
git branch -f svn/master master
git checkout "${HEAD#refs/heads/}"
git branch -D svn/tmp
6.done.
没有评论:
发表评论