1 | Registry Operations Curriculum |
---|
2 | Subversion (SVN) and Change Control Exercises |
---|
3 | |
---|
4 | Notes: |
---|
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 | |
---|
13 | Exercises |
---|
14 | --------- |
---|
15 | |
---|
16 | Exercises Part I |
---|
17 | ---------------- |
---|
18 | |
---|
19 | 0. Log in to your PC or open a terminal window as the root user. |
---|
20 | |
---|
21 | Once you are logged in you can continue with these exercises. |
---|
22 | If Subversion is not already installed: |
---|
23 | |
---|
24 | $ apt-get install subversion |
---|
25 | |
---|
26 | 1. Create a root directory for the SVN repository: |
---|
27 | |
---|
28 | # mkdir /svn |
---|
29 | |
---|
30 | 2. Create the repository: |
---|
31 | |
---|
32 | # svnadmin create /svn/arocarchive |
---|
33 | |
---|
34 | 3. Create user and password |
---|
35 | |
---|
36 | # vi /svn/arocarchive/conf/passwd |
---|
37 | aroc = YourPassword |
---|
38 | |
---|
39 | 4. 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 | |
---|
48 | 5. Start the service: |
---|
49 | |
---|
50 | # svnserve -d -r /svn/arocarchive |
---|
51 | |
---|
52 | 6. Go to your home directory and create a test file: |
---|
53 | |
---|
54 | # cd |
---|
55 | # vi config.txt |
---|
56 | |
---|
57 | Maybe type some text in the file. Save and exit. |
---|
58 | |
---|
59 | 7. Import the test file in to the repository: |
---|
60 | |
---|
61 | # svn import config.txt svn://localhost/config.txt |
---|
62 | |
---|
63 | You'll be placed in an editor where you can make a comment about the |
---|
64 | file being placed in the repository. At the top of the file add some |
---|
65 | short comment, then save and exit from the file. Accept the default filename. |
---|
66 | |
---|
67 | Next you'll need to enter in a root password, the username you defined and |
---|
68 | the password for the user. |
---|
69 | |
---|
70 | Finally, you may see a warning about storing unencrypted passwords. For now |
---|
71 | say "yes" to the prompt to continue. |
---|
72 | |
---|
73 | If 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 | |
---|
80 | 8. List the repository: |
---|
81 | |
---|
82 | # svn list svn://localhost |
---|
83 | |
---|
84 | You should just see the name of the file we have committed, or: |
---|
85 | |
---|
86 | config.txt |
---|
87 | |
---|
88 | 9. Create a local copy of the repository |
---|
89 | |
---|
90 | # cd /tmp |
---|
91 | # svn checkout svn://localhost |
---|
92 | # cd localhost |
---|
93 | |
---|
94 | The default directory name is "localhost" in this case. |
---|
95 | |
---|
96 | 10. Edit and make changes to config.txt |
---|
97 | |
---|
98 | # vi config.txt |
---|
99 | |
---|
100 | 11. 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 | |
---|
120 | 12. 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 | |
---|