Agenda: exercises-subversion.txt

File exercises-subversion.txt, 3.1 KB (added by admin, 9 years ago)
Line 
1Registry Operations Curriculum
2Subversion (SVN) and Change Control Exercises
3
4Notes:
5------
6* Commands preceded with "$" imply that you should execute the command as
7  a general user - not as root.
8* Commands preceded with "#" imply that you should be working as root.
9* Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>")
10  imply that you are executing commands on remote equipment, or within
11  another program.
12
13Exercises
14---------
15
16Exercises Part I
17----------------
18
190. Log in to your PC or open a terminal window as the root user.
20
21Once you are logged in you can continue with these exercises.
22If Subversion is not already installed:
23
24        $ apt-get install subversion
25
261. Create a root directory for the SVN repository:
27
28        # mkdir /svn
29
302. Create the repository:
31
32        # svnadmin create /svn/arocarchive
33
343. Create user and password
35
36        # vi /svn/arocarchive/conf/passwd
37        aroc = YourPassword
38
394. Configure access
40
41        # vi /svn/arocarchive/conf/svnserve.conf
42
43        Remove comments and don't leave space at the start of the lines:
44
45        auth-access=write
46        passwd-db=passwd
47
485. Start the service:
49
50        # svnserve -d -r /svn/arocarchive
51
526. Go to your home directory and create a test file:
53 
54        # cd
55        # vi config.txt
56
57Maybe type some text in the file. Save and exit.
58
597. Import the test file in to the repository: 
60
61        # svn import config.txt svn://localhost/config.txt
62
63You'll be placed in an editor where you can make a comment about the
64file being placed in the repository. At the top of the file add some
65short comment, then save and exit from the file. Accept the default filename.
66
67Next you'll need to enter in a root password, the username you defined and
68the password for the user.
69
70Finally, you may see a warning about storing unencrypted passwords. For now
71say "yes" to the prompt to continue.
72
73If it all works you should see something like:
74
75        Sore password unencrypted (yes/no)? yes
76        Adding          config.txt
77       
78        Committed revision 1.
79
808. List the repository:
81
82        # svn list svn://localhost
83
84You should just see the name of the file we have committed, or:
85
86        config.txt
87
889. Create a local copy of the repository
89       
90        # cd /tmp
91        # svn checkout svn://localhost
92        # cd localhost
93
94The default directory name is "localhost" in this case.
95
9610. Edit and make changes to config.txt
97
98        # vi config.txt
99
10011. Commit the changes you just made in your local repository to the master SVN
101    repository:
102
103        # svn commit
104
105        Again you'll have a change to add some comments. Do this save the file
106        and exit.
107
108        You should see:
109
110        Committed revision 2.
111
112        That's it. You are now using subversion in a local repository:
113
114        /tmp/localhost
115
116        In conjunction with the master repository:
117
118        /svn/arocarchive
119
12012. Run a few more svn commands on the local copy of the master repository
121
122        As you are in /tmp/localhost if you type:
123
124        # ls -lah
125
126        you'll see a hidden directory ".svn" - This is what tells the svn
127        command that there is a repository. So, if you type:
128
129        # svn list
130
131        You'll get back:
132
133        config.txt
134
135        Try running a few more svn commands:
136
137        # svn log
138        # svn info
139        # svn help
140
141
142
143
144
145
146