How do I get files from my svn repo to staging or production system?
I have just started playing with version control. I have installed svn and svnX om my Mac and setup a free project with an Subversion repo on assembla.com.
I have not uploaded any files to my SVN repo as of y开发者_StackOverflowet. I have spent most of the day reading about the topic and figuring out what to do.
I have started to get a handle on the different concepts, but I am wondering how do I get my files from Assembla to my staging or production website.
Is this done through a commit? I can't seem to find anything about this process? Am I going to have to use ftp for the file transfer?
A commit for subversion is like a "save this now on the server". When you want to publish your stuff on a server, you can do it in two simple ways:
- (requires root/user access to the server) you just do a export
svn export URL /path/to/whatever
on the server (installed subversion client is required). An export is like a normal checkout but you don't have .svn directories and files after that. - (requires uploading possibility like ftp) you do the export on your pc and upload everything on the server.
I never used something like this but: some IDE/tools/apps might have something like a publish assistant which might do that for you, so it depends on what you use...
Before I comment on your question specifically, I would recommend that you look at one of the DVCS (Distributed Version Control Systems) like Git, Mercurial, and Bazaar. They each have their pros and cons, as addressed in the question.
SVN was a huge step-forward from CVS and definitely was a the tool to use in its day. But the reality is that DVCSes are an even bigger step forward over SVN than SVn was over CVS.
To address your specific question, I am going to do it in pieces.
First, a commit is when you put a file or a revision of that file into you repo. I haven't ever used Assembla.com, but I am assuming that it is functioning as your SVN repo.
In this model, you would be working on file on your local system and once you have then ready, you would commit them to your repo on Assembla.com.
On your staging or production system, you would checkout your SVN repo and then follow any steps required to deploy your application.
You could, if required, edit files on the staging or production system and then commit the revision to your SVN repo. You would then checkout from your SVN repo to your local system to ensure that you were in sync.
Essentially the same model would be followed - with variations - if you used Git, Mercurial, or Bazaar.
精彩评论