Agenda: exercises-subversion.txt

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