sh 将项目从svn同步到git
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 将项目从svn同步到git相关的知识,希望对你有一定的参考价值。
#!/bin/bash
# Configuration
# -------------
declare -r REP_DIR=/home/nitanoc/workspace/RDIS2
declare -r LOG_DIR=${REP_DIR}/.log
# Main
# ----
git_svn_sync() {
local -r CWD=`pwd`
while [ "$1" != "" ]; do
printf "\n * Synchronizing $1 from svn to git...\n\n"
cd $1 && \
git svn fetch --no-follow-parent && \
git svn rebase && \
git checkout master && \
git rebase svn/trunk && \
git push origin master
cd $CWD
printf "\nDone.\n"
shift
done
}
mkdir -p ${LOG_DIR}
git_svn_sync `ls -d ${REP_DIR}/*/` | tee -i "${LOG_DIR}/git-svn-sync-`date +%Y%m%d%H%M%S`.log"
以上是关于sh 将项目从svn同步到git的主要内容,如果未能解决你的问题,请参考以下文章