那麼,有這樣做沒有一個好辦法。但是,這是一個建議。
你可以做的是在公共目錄之外的服務器上創建一個裸存儲庫。這個存儲庫會將更改推送到您的SVN存儲庫,並且會像SVN倉庫的門衛一樣。你的網站已經運行一個SVN倉庫。在此裸倉庫
$ cd; mkdir site_bare.git; cd site_bare.git
$ git --bare init
您可以在使用shell腳本,像https://github.com/deanc/wordpress-plugin-git-svn post-commit鉤子。
#!/bin/sh
echo
echo "**** Pulling changes into the SVN repository [Hub's post-update hook]"
echo
cd $HOME/www || exit
unset GIT_DIR
# Change to SVN dir and commit changes
echo "Changing directory to SVN and committing to trunk"
cd $SVNPATH/trunk
svn commit --username=$SVNUSER -m "$COMMITMSG"
# Create a new tag and commit it :)
echo "Creating new SVN tag"
cd $SVNPATH
svn copy trunk/ tags/$NEWVERSION1
svn commit --username=$SVNUSER -m "Updating tag to $NEWVERSION1"
# Update the version number
echo "Updating version number for future executions"
cd $CURRENTDIR
echo $NEWVERSION1 > version.txt
exec git-update-server-info
我採取這種從https://github.com/deanc/wordpress-plugin-git-svn/blob/master/deploy.sh但你可以得到git的提交信息,而不是直接的要求之一。
在本地計算機上,添加純倉庫作爲遠程和更改推到它:
git remote add bare <bare-repository-url>
這是如何工作的,你寫一些代碼,並將其推到純倉庫,其利用其職務-update掛鉤將更改推送到SVN回購。
你將不得不修改上面的代碼來推送更改。我剛剛給了參考。
我希望有一些少一些定製,可能使用卡皮斯特拉諾?儘管我不太清楚它是否也是正確的答案。感謝您的答覆! –