开发者

Pull an svn repo into one folder in my git-controlled application

I have an application with which i manage the source control with git. One of the folders is just a copy of the contents of another folder that is in outs开发者_如何学Cide the app, in an svn-controlled repo. To be specific:

this folder:

<app root>/public/assets/players/millionaire

Just needs to use the contents of an svn repo with the url:

http://<my_domain>/charanga/elearning%20players/millionaire_DEPLOY

Currently my workflow is

  • get notified that the svn repo has been updated
  • go to the svn folder and do "svn update"
  • rsync the contents of the svn folder (minus the .svn folders) into the relevant app folder
  • "git status" to see the changes and "git commit" to commit them in.

This is kind of clumsy though. What are my options for incorporating the svn folder automatically? Can i avoid having all of the .svn folders in my git-controlled codebase? (There's no rational reason for this, i'd just like to keep it as clean as possible)

grateful for any advice - max


Sounds like your workflow can be achieved using CommitMonitor: The tool periodically checks a SVN repo and (according to image 2 in the screenshots), it lets you specify a script that shall be executed when new revisions are detected:

Pull an svn repo into one folder in my git-controlled application

Content of the script could be (in bash):

#!/bin/bash
# define variables
SVN_REPO="http://<my_domain>/charanga/elearning%20players/millionaire_DEPLOY"
GIT_REPO="$APP_ROOT/public/assets/players/millionaire"
# fetch latest svn revision
svn export --force $SVN_REPO $GIT_REPO # force because the files already exist
cd $GIT_REPO
# commit the changes to git
git commit -a -m "pulled in from SVN"

This way, you don't need to have a local WC of the SVN repo at all...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜