0

I'm comparing SVN and Git.

I know 'svn checkout' is the same as 'git clone' in that both include the history of the original repository.

In Git, once 'git clone' is done, I don't need to 'git clone' any more to get the history of the original repository, because I can 'git fetch' and 'git merge' which are lighter and quicker than 'git clone'. So 'git fetch' and 'git merge' can keep my repository as the perfect backup of the original repository.

But what about SVN? 'svn checkout' is very expensive work, because it deals with the whole repository. So to do 'svn checkout' whenever I want is not a good choice. 'svn update' is far lighter than 'svn checkout' because 'svn update' delivers only updated stuff.

I wonder if 'svn update' includes the history of the original repository. If it does, 'svn update' can keep my checkedout repository as the backup of the original one. If it does not, there is no easy way to keep my checkedout repository as the backup of the original one.

Please give me the good answer ^^

Zoe
  • 27,060
  • 21
  • 118
  • 148
hanmomhanda
  • 305
  • 1
  • 2
  • 15
  • 2
    AFAIR 'svn checkout' does only fetch the latest version from repository, not the complete history. If you want to access older revisions you have to connect to the SVN server again. – Robert Jan 22 '13 at 12:15

3 Answers3

2

Your initial impression is wrong: svn checkout is not the same as git clone.

svn checkout only fetches the latest revision, and svn update only updates to the latest revision. To access the history of the project in any fashion, you must contact the server.

user4815162342
  • 141,790
  • 18
  • 296
  • 355
1

SVN keeps only the working copy locally. This means that a svn checkout only creates a working copy of the current HEAD (and a svn update updates an existing working copy to the current HEAD), but the commit history is still kept on the server (if you do for example a svn log, the commit history is loaded from server).

Git on the other side keeps the entire repository -- not only the working copy ("working tree" in git-speak), but also the entire commit history.

If you want to revert your SVN working copy to an older version, you can do that using svn update -r[revision number], but then again SVN will pull the specified revision from server.

helmbert
  • 35,797
  • 13
  • 82
  • 95
0

To keep a backup of your repository, rather than checking it out, I'd strongly suggest you look at using svnadmin dump or svnadmin hotcopy

paul
  • 21,653
  • 1
  • 53
  • 54
  • [Official documentation on backing up repositories](http://svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.html#svn.reposadmin.maint.backup) – alroc Jan 22 '13 at 15:56