Download - Source Control
![Page 1: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/1.jpg)
Source Control
Dr. Scott Schaefer
![Page 2: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/2.jpg)
Version Control Systems
• Allow for maintenance and archiving of multiple versions of code / other files• Designed for text files… can be used with other
files, but some functionality won’t work
• Saves multiple copies of the same file
• Tracks changes to each file among multiple users
• Allows multiple users to edit the same file at the same time
![Page 3: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/3.jpg)
Subversion
• Open-source version control system• Builds on CVS• Can handle local or remote repositories• Stores and transfers diffs of files… not
entire files (efficient)
![Page 4: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/4.jpg)
ExampleRepository
User 1
User 2
X Z
Y
![Page 5: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/5.jpg)
ExampleRepository
User 1
User 2
X Z
Y
add Xadd Yadd Z
![Page 6: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/6.jpg)
ExampleRepository
User 1
User 2
X Z
Y
CommitX Z
Y1
![Page 7: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/7.jpg)
ExampleRepository
User 1
User 2
X Z
Y
X Z
Y
Checkout
X Z
Y
1
![Page 8: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/8.jpg)
ExampleRepository
User 1
User 2
X Z
Y
X Z
Y
Modify Y
X Z
Y
1
![Page 9: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/9.jpg)
ExampleRepository
User 1
User 2
X Z
Y
X Z
Y
Commit
X Z
Y
X Z
Y
1
2
![Page 10: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/10.jpg)
ExampleRepository
User 1
User 2
X Z
Y
X Z
Y
Update
X Z
Y
X Z
Y
1
2
![Page 11: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/11.jpg)
ExampleRepository
User 1
User 2
X Z
Y
X Z
Y
Modify X
X Z
Y
X Z
Y
Modify X1
2
![Page 12: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/12.jpg)
ExampleRepository
User 1
User 2
X Z
Y
X Z
Y
Commit
X Z
Y
X Z
Y
X Z
Y
1
2
3
![Page 13: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/13.jpg)
ExampleRepository
User 1
User 2
X Z
Y
X Z
Y
Update
X Z
Y
X Z
Y
X Z
Y
merged text!
1
2
3
![Page 14: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/14.jpg)
Another ExampleRepository
User 1
User 2
X
Y
X Z
Y
X Z
Y
1
Delete Z
![Page 15: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/15.jpg)
Another ExampleRepository
User 1
User 2
X
Y
X Z
Y
X Z
Y
1
Commit
X
Y2
![Page 16: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/16.jpg)
Another ExampleRepository
User 1
User 2
X
Y
X Z
Y
X
Y
1
Update
X
Y2
![Page 17: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/17.jpg)
Conflicts
• Happen when you and someone else edit the same line of code
<<<<<<<<< .mine
Your change
=========
Someone else’s change
>>>>>>>>> .r 23
• Subversion keeps both your original (foo.mine) and the revision (foo.23)
![Page 18: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/18.jpg)
Living with Version Control
• ALWAYS update before you commit changes
• If files change during the update, make sure everything works before you commit
• If you have a conflict, you MUST resolve the conflict before committing
• Update often to avoid conflicts
• Add descriptions to all of your commits
![Page 19: Source Control](https://reader035.vdocument.in/reader035/viewer/2022062315/5681501f550346895dbe03b3/html5/thumbnails/19.jpg)
Your Project
• You MUST use version control for all of your projects
• I strongly suggest using Google Code as your SVN server• You can access it from anywhere