Skip to content

Instantly share code, notes, and snippets.

@amdgigabyte
Created October 8, 2012 11:51
Show Gist options
  • Save amdgigabyte/3852105 to your computer and use it in GitHub Desktop.
Save amdgigabyte/3852105 to your computer and use it in GitHub Desktop.
from git repo to svn repo
#! /bin/sh
# build from git repo to svn repo
srcDir=~/Sites/workspace/pix/
vsDir=~/Sites/vhosts/a.tbcdn.cn/apps/pix/
toolsDir=$srcDir'tools/'
echo 'Now build from Git branch to SVN branch'
gitTimeStamp=`git st $srcDir | grep -Eo '(SVN.*$|SVN/TRUNK)'`
gitTimeStamp=${gitTimeStamp##SVN/}
if [ $gitTimeStamp = '' ];then
echo $gitTimeStamp
echo 'git 分支的规则不正确'
exit
else
echo $gitTimeStamp
svnTimeStamp=`svn info $vsDir | grep -Eo 'http://svn.app.taobao.net/repos/pix/(branches/TRC_[0-9]{8}|trunk)'`
svnTimeStamp=${svnTimeStamp##http://svn.app.taobao.net/repos/pix/}
echo $svnTimeStamp
#如果svn和git的分支或者主干对应,那么就执行build
#
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment