sub version intro
TRANSCRIPT
![Page 1: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/1.jpg)
A day with Subversion (SVN)
Sebastian Heimann
Institut fur Geophysik, Arbeitsgruppe Seismologie
February 15, 2007
![Page 2: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/2.jpg)
Outline
1. Concepts (by example)
2. Vocabulary
3. Benefits
4. Further reading
![Page 3: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/3.jpg)
The initial work
Let’s assume we have just made a quick and dirty hack, which wenow want to put under version contol for further development:
> ls /my/hack
![Page 4: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/4.jpg)
Create an empty repository
> svnadmin create --fs-type fsfs /my/repos
Repository
![Page 5: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/5.jpg)
The initial import
> svn import /my/hack file:///my/repos/hack/trunk \-m ’Initial import’
Repository
1
![Page 6: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/6.jpg)
Checkout a working copy of hack
> svn checkout file:///my/repos/hack/trunk /work/hack
Working copyRepository
1
![Page 7: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/7.jpg)
Add a new feature to hack
> cd /work/hack ; vi hack
Working copyRepository
1
![Page 8: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/8.jpg)
Commit your changes to the repository
> svn commit
Working copyRepository
1
2
![Page 9: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/9.jpg)
More than one person can now work on hack
Fu’s working copy
Repository
1
2 Fara’s working copy
![Page 10: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/10.jpg)
Both implement their improvements
Fu’s working copy
Repository
1
2 Fara’s working copy
![Page 11: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/11.jpg)
Fu commits his changes to the repository
> svn commit
Fu’s working copy
Repository
1
2
3
Fara’s working copy
![Page 12: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/12.jpg)
Fara commits her changes to the repository
Fu’s working copy
Repository
1
2
4
3
> svn commit
Fara’s working copy
![Page 13: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/13.jpg)
To get each others changes
> svn update
Fu’s working copy
Repository
1
2
4
3
> svn update
Fara’s working copy
![Page 14: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/14.jpg)
Fu and Fara can go back to any previous revision
> svn update -r 1
Fu’s working copy
Repository
1
2
4
3
> svn update -r 3
Fara’s working copy
![Page 15: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/15.jpg)
Internally the repository will only store differences...
Repository
1
2
4
3
![Page 16: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/16.jpg)
...but it pretends to make a new copy on every commit.
Repository
1
2
4
3
![Page 17: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/17.jpg)
Sometimes it may be useful to branch the project...
> svn cp -r 2 file:///my/repos/hack/trunk \file:///my/repos/hack/branches/mad
![Page 18: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/18.jpg)
...this creates a copy directly in the repository.
.../trunk
1
2
4
3
5
.../branches/mad
![Page 19: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/19.jpg)
Check out a working copy of the branch
> svn checkout file:///my/repos/hack/branches/mad \/work/mad-hack
![Page 20: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/20.jpg)
You can now safely experiment with mad-hack, whilemaintaining a stable version of hack in the trunk.
> cd /work/mad-hack
> # edit it
> svn commit1
2
4
3
5
6
![Page 21: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/21.jpg)
Tagging: You can also use the branching mechanism tomark a specific revisions as somehow special.
> svn cp -r 2 file:///my/repos/hack/trunk \file:///my/repos/hack/tags/stable-v1
![Page 22: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/22.jpg)
Tagged stable version 1 of hack
.../trunk
1
2
4
3
5
.../tags/stable-v1
![Page 23: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/23.jpg)
Vocabulary
I repository
I revision
I working copy
I to check out
I to commit
I to update
![Page 24: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/24.jpg)
Vocabulary
I to branch
I to merge
I to tag
![Page 25: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/25.jpg)
Conventions
I hack/trunk
I hack/branches/mad
I hack/tags/stable-v1
![Page 26: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/26.jpg)
Benefits
I Unlimited undo!
I Collaborate with others!
I Enforces structured development
I Makes you document what you are doing
I Automatic changelog!
I Helps you organize your mess in $HOME
![Page 27: Sub Version Intro](https://reader035.vdocument.in/reader035/viewer/2022062704/555a672ad8b42ae7218b4b97/html5/thumbnails/27.jpg)
Further reading
Tutorial
I http://artis.imag.fr/~Xavier.Decoret/resources/svn/
Documentation (A good intro is in Chapter 2)
I http://svnbook.red-bean.com/nightly/en/
Online help
> svn help
> svn [command] help