Agenda: version-control-exercises.txt

File version-control-exercises.txt, 3.3 KB (added by hervey, 8 years ago)
Line 
1Subversion (SVN) and Change Control
2===================================
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>" or "mysql>")
10  imply that you are executing commands on remote equipment, or within
11  another program.
12* If a command line ends with "\" this indicates that the command continues
13  on the next line and you should treat this as a single line.
14
15Exercises Part I
16================
17
180. Log in to your PC.
19
20Once you are logged in you can continue with these exercises.
21If Subversion is not already installed:
22
23        $ sudo bash                             (become root user)
24
25        # apt-get install subversion            (install subversion)
26
271. Create a root directory for the SVN repository:
28
29        # mkdir /svn
30
312. Create the repository:
32
33        # svnadmin create /svn/nmmarchive
34
353. Create user and password
36
37        # vi /svn/nmmarchive/conf/passwd
38        nmm = CLASSPASSWORD
39
404. Configure access
41
42        # vi /svn/nmmarchive/conf/svnserve.conf
43
44Remove comments and don't leave one space at the start of the lines:
45
46         auth-access=write
47         passwd-db=passwd
48
49Exit and save the file.
50
515. Start the service:
52
53        # svnserve -d -r /svn/nmmarchive
54
556. Go to your home directory and create a test file:
56 
57        # cd
58        # vi config.txt
59
60Add some text in the file. Save and exit.
61
627. Import the test file in to the repository: 
63
64        # svn import config.txt svn://localhost/config.txt
65
66You'll be placed in an editor where you can make a comment about the
67file being placed in the repository. At the top of the file add some
68short comment, then save and exit from the file. Accept the default filename.
69
70You'll likely end up in the "joe" editor. If so, add a comment at the top of the file,
71then press CTRL-K-X to exit and save.
72
73Next you'll need to enter in a root password, the username you defined and
74the password for the user.
75
76Finally, you may see a warning about storing unencrypted passwords. For now
77say "yes" to the prompt to continue.
78
79If it all works you should see something like:
80
81        Sore password unencrypted (yes/no)? yes
82        Adding          config.txt
83       
84        Committed revision 1.
85
868. List the repository:
87
88        # svn list svn://localhost
89
90You should just see the name of the file we have committed, or:
91
92        config.txt
93
949. Create a local copy of the repository
95       
96        # cd /tmp
97        # svn checkout svn://localhost
98        # cd localhost
99
100The default directory name is "localhost" in this case.
101
10210. Edit and make changes to config.txt
103
104        # vi config.txt
105
10611. Commit the changes you just made in your local repository to the master SVN
107    repository:
108
109        # svn commit
110
111        Again you'll have a change to add some comments. Do this save the file
112        and exit.
113
114        You should see:
115
116        Committed revision 2.
117
118        That's it. You are now using subversion in a local repository:
119
120        /tmp/localhost
121
122        In conjunction with the master repository:
123
124        /svn/nmmarchive
125
12612. Run a few more svn commands on the local copy of the master repository
127
128        As you are in /tmp/localhost if you type:
129
130        # ls -lah
131
132        you'll see a hidden directory ".svn" - This is what tells the svn
133        command that there is a repository. So, if you type:
134
135        # svn list
136
137        You'll get back:
138
139        config.txt
140
141        Try running a few more svn commands:
142
143        # svn log
144        # svn info
145        # svn help
146
147
148
149
150
151
152