开发者

SVN-How to commit a file to separate repositories

I'm looking out for a solution where I can save a file to 2 different repositories using SVN.

I have to 2 repositories one 开发者_StackOverflow中文版is my local repository in my system and the other is the repository in production server when I make change to a file in local, How can I commit the file to 2 different repositories in different locations at a time.

The local repository is setup in such a way it is feasible for the developer. And the production repository has a different folder structure.


As far as I know, this is not possible. A working copy can be under the control of only one repository at a time.

This may be achievable using a post-commit hook, but it's going to be complicated.

The easiest way might be having two directories locally, the one mirroring the other. You would still have to do two commits, though.

This sounds a bit like bad practice. Are you sure this is sensible and necessary? Is there not a better solution for your scenario, an external for example?


The only Subversion-only solution I can think of is to use hooks, more specifically a post-commit hook in your local server that submits stuff to the remote server. The obvious drawback is that you have to code the scripts yourself and it looks like a lot of work.

I assume such arrangement is a workaround to use local versions in your development. I believe that people normally use third-party software to accomplish it. You can:

  • Install another version control system (such as git, mercurial or bazaar) for local versions. Just remember to omit your local versions database from Subversion.
  • Use SVK on top of Subversion, so you can choose what to commmit to the remote repository.
  • Use an IDE that features custom local versions.


Have you seen http://wandisco.com/ ? This is what they do and more.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜