source control

19
Source Control Dr. Scott Schaefer

Upload: anais

Post on 21-Jan-2016

26 views

Category:

Documents


0 download

DESCRIPTION

Source Control. Dr. Scott Schaefer. 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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Source Control

Source Control

Dr. Scott Schaefer

Page 2: Source Control

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

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

ExampleRepository

User 1

User 2

X Z

Y

Page 5: Source Control

ExampleRepository

User 1

User 2

X Z

Y

add Xadd Yadd Z

Page 6: Source Control

ExampleRepository

User 1

User 2

X Z

Y

CommitX Z

Y1

Page 7: Source Control

ExampleRepository

User 1

User 2

X Z

Y

X Z

Y

Checkout

X Z

Y

1

Page 8: Source Control

ExampleRepository

User 1

User 2

X Z

Y

X Z

Y

Modify Y

X Z

Y

1

Page 9: Source Control

ExampleRepository

User 1

User 2

X Z

Y

X Z

Y

Commit

X Z

Y

X Z

Y

1

2

Page 10: Source Control

ExampleRepository

User 1

User 2

X Z

Y

X Z

Y

Update

X Z

Y

X Z

Y

1

2

Page 11: Source Control

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

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

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

Another ExampleRepository

User 1

User 2

X

Y

X Z

Y

X Z

Y

1

Delete Z

Page 15: Source Control

Another ExampleRepository

User 1

User 2

X

Y

X Z

Y

X Z

Y

1

Commit

X

Y2

Page 16: Source Control

Another ExampleRepository

User 1

User 2

X

Y

X Z

Y

X

Y

1

Update

X

Y2

Page 17: Source Control

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

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

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