Professional Documents
Culture Documents
1 2
Outline
1. Introduction
OBJECT-ORIENTED PROGRAMMING 2. Models
1.3 VERSION CONTROL 3. Vocabulary
Nguyen Thi Thu Trang 4. Tools
trangntt@soict.hust.edu.vn
1 2
3 4
3 4
5 6
Version control for teams (1/2) Version control for teams (2/2)
• Scenario: • Scenario:
• You change one part of a program--it works • You make a number of improvements to a class
• Your co-worker makes a number of different
• Your co-worker changes another part--it works
improvements to the same class
• You put them together--it doesn’t work
• How can you merge these changes?
• Some change in one part must have broken
something in the other part
• What were all the changes?
5 6
7 8
7 8
9 10
9 10
11 12
11 12
13 14
Check-out Lock
A A
A Аndy
13 14
15 16
Commit
A
A
Andy
Andy
Bobby
Bobby
Andy
Andy
35
34
15 16
17 18
Andy Andy
Bobby
Andy Andy
(Local Edit)
Bobby
Andy Bobby
36 Andy
37
17 18
19 20
Andy
Bobby A
Bobby
Bobby
Andy
38
Andy
40
19 20
21 22
The Copy-Modify-Merge Model (2) Model (2) The Copy-Modify-Merge Model (3)
2.2. The Copy-Modify-Merge 2.2. The Copy-Modify-Merge Model (3)
Both of them
edit the local Bobby commits Repository
Repository
copies of the her changes to
file (in the A
the repository. Bobby Commit
same time).
Bobby Bobby
Andy Andy
(Local Edit)
21 22
23 24
Andy
Andy
Andy
&
Bobby
(Local
Conflict) Bobby (Local
Merge) Bobby
Andy
Andy
43
44
23 24
25 26
Andy Andy
& &
Bobby Bobby
Bobby Bobby
Andy Andy
46
45
25 26
27 28
27 28
29 30
(Local Edit)
(Local Edit) Andy Bobby
A A A A
29 30
31 32
31 32
33 34
33 34
35 36
35 36
37 38
Outline 3. Vocabulary
1. Introduction • Repository (source control repository)
• A server that stores the files (documents)
2. Versioning Models • Keeps a change log
37 38
39 40
Vocabulary Vocabulary
• Change • Conflict
• A modification to a local file (document) that is under version • The simultaneous change to a certain file by multiple users
control • Can be solved automatically and manually
• Change Set / Change List • Update, Get Latest Version, Fetch / Pull
• A set of changes to multiple files that are going to be committed at • Download the latest version of the files from the repository to a
the same time local working directory + merge conflicting files
• Commit, Check-In • Undo Check-Out, Revert / Undo Changes
• Submits the changes made from the local working copy to the • Cancels the local changes
repository
• Restores their state from the repository
• Automatically creates a new version
• Conflicts may occur!
39 40
41 42
Vocabulary Outline
• Merge 1. Introduction
• Combines the changes to a file changed locally and simultaneously
in the repository 2. Versioning Models
• Can be automated in most cases
• Label / Tag
3. Vocabulary
• Labels mark with a name a group of files in a given version 4. Tools
• For example a release
• Branch / Branching
• Division of the repositories in a number of separate workflows
41 42
43 44
43 44
45 46
45 46
47 48
47 48
49 50
• GitHub provides own Windows client • 1-minute signup, without heavy approval process
49 50
51
• Bitbucket – http://bitbucket.org
• Source control (Mercurial), issue tracker, wiki, management tools
• Private projects, free and paid editions
51