Create a local svn repository
Today I created a local svn repository to keep version history of modification. It is a task long overdue.
Why to create svn in local machine?
Pro:
1. local management. There is no network latency.
2. version history is important.
Con: doesn't have disaster recovery from remote copy.
It is a trade-off between how important your data is and how resourceful you are.
Here are the steps to create it in my Ubuntu 12.04:
To minimize the footprint, I use "direct repository access (on local disk)" (Reference: https://help.ubuntu.com/community/Subversion#Access_Methods) in /home/svn.
- sudo apt-get install subversion # of course.
- sudo mkdir /home/svn
- sudo chown ben /home/svn # make myself the owner of this folder
- svnadmin create /home/svn/django # create repository. note: this is created under my own account.
#because I already have some sites, I need to add them into the repository - cd ~/mysites
- svn import "file:///home/svn/django" -m 'initial import'
# one thing bothers me is that, after importing, the files ARE in repository, but the current folder ~/mysites "is not a working copy" yet, because there is no .svn folder create here.
# so I have to check out the folder from the repository: - svn checkout "file:///home/svn/django" # the files are checkout into ~/mysites/django folder. # this folder is good to use, you can commit/update now.
0 Comments:
<< Home