开发者

Setup Tortoise SVN with existing folder

I'm trying quite desperately to setup TortoiseSVN... I have two folders - /live/ and /test/ - I want them to be mirrored, and then if I update the /test/ folder the SVN will detect this, and update the /live/ folder appropriately when I commit.. I have tried countless things to get this working, but unfortunately have had no joy.

I'm probably being very stupid, but I find the whole SVN thing to be very baffling, and apart from Versions (Mac) I've never actually been able to get one working. In an ideal world I'd like to select the two folders, and away I go!

Thank you!

(edit) After reading the below, and still failing spectacularly, I may unfortunately have to give this a miss. Thank you so much for the replies but really this is quite beyond me. I shall just use WinMerge and sacr开发者_开发百科ifice the ability to have an archive of changes that I've made. Once again though thank you so much for the replies, hopefully the answers will be useful to someone who actually has the mental capacity to set these things up!


Before you get too confused with SVN, read chapters 1-3 of this book.

SVN is not an automated copy tool. It's not a backup tool. It's a revision control system. Using it to do something that it wasn't meant to do is possible; however, the results are often less desirable than using the right tool for the job.


Subversion (using TortoiseSVN or command-line) is not really meant for things like mirroring.

You could either do an update manually to /live/ to when you commit /test/ or look into adding a Post-Commit Hook to TortoiseSVN to do this automatically with a client side Hook script.

TortoiseSVN documentation

Note: If you do not need to edit or change /live/, you should probably look at the Subversion export command instead of having live be a working copy (you would still need to do this manually or add a post-commit hook).


TortoiseSVN is a Subversion client. At the very least you need to create a Subversion repository in which to store your files, and then check out your files from the Subversion repository into a directory on your computer. I really think you ought to read a bit about how Subversion works. This book is the official reference.


It sounds like you want two working copies of the same branch (or trunk) - One in live and one in test. To do this create the two directories and do a svn checkout of your branch (or trunk) into each one (i.e. do the checkout twice). Make sure you use the same branch (or trunk) in both checkouts.

When you svn commit in test, your next svn update in live will pick up the changes.

I'm not sure why you'd want to do this though. Until you commit, you can edit "in live" as long as you need it. If you need version control of your changes on test, you'll want to read about branching.


If I understand correctly there's repository and there are two working copies, test and live, and you would like the live working copy to be automatically updated when you commit changes to test working copy.

There is no built-in functionality that instructs some working copy to automatically updates itself if new revision is available. Update is always done manually.

I believe that you actually need some kind of "deploy" functionality (as name "live" suggests). Deploying is not the job of SVN. You need some other tool for that.


Most already was said in shortened form, I can add almost nothing new OK. I'll try one more time to draw detailed pic

First of all - question is badly formulated in terms of terminology and business-task. If TEST is WorkingCopy of your repo (it seems so) and LIVE is unpacked directory with content, identical you latest revision in repo (HEAD), then you can and must, as wrote @crashmstr, use post-commit hook in TSVN to produce fresh archive

  • TortoiseSVN - Settings - Hook scripts - Add
  • Hook type - Post-Commit, WC path - path to TEST, Command Line to Execute - /somename.bat, Wait and Hide - mark

Here are relevant parts from my Releaser.bat (I build archive with custiom name after each commit, thus using subwcrev added some complexity)

SubWCRev.exe e:\Projs\CustomLocations e:\Projs\Builder.tpl  z:\Builder.bat
...
call z:\Builder.bat

template from Builder.tpl

"c:\Program Files\_Net\VisualSVN Server\bin\svn.exe" export e:\Projs\CustomLocations\trunk z:\trunk$WCDATE=%Y%m%d$-r$WCREV$

become smth.like

"c:\Program Files\_Net\VisualSVN Server\bin\svn.exe" export e:\Projs\CustomLocations\trunk z:\trunk20110926-r1129

in executed z:\Builder.bat and as result I

  • always
  • automatically
  • after each commit

have fresh separate version of my work, marked with unique id. Yes, it require some work (one time) and presence of SVN command-lene client, but it's fair price

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜