01.2-VersionControl
01.2-VersionControl
Outline
1. Introduction
2. Models
3. Vocabulary
4. Tools
3
Tools: diff
• There are a number of tools that help you spot
changes (differences) between two files
• Tools include diff, rcsdiff, jDiff, etc.
• Of course, they won't help unless you kept a copy
of the older version
• Differencing tools are useful for finding a small
number of differences in a few files
8
Tools: jDiff
• jDiff is a plugin for the jEdit editor
• Advantages:
• Everything is color coded
• Uses synchronized scrolling
• It's inside an editor--you can make changes directly
• Disadvantages:
• Not stand-alone, but must be used within jDiff
• Just a diff tool, not a complete solution
9
Tools: jDiff
10
Outline
1. Introduction
2. Versioning Models
3. Vocabulary
4. Tools
12
2. Versioning Models
• Lock-Modify-Unlock
• Copy-Modify-Merge
• Distributed Version Control
13
Check-out
A
Bobby
Andy
14
Lock
A
Аndy
(Local Edit)
Bobby
Andy
15
Andy
Bobby
Andy
16
Commit
A
Andy
Bobby
Andy
17
Andy
Andy
(Local Edit)
Bobby
Andy
18
Bobby finishes,
Repository
commits her changes
and unlocks the file. Andy
Bobby
Commit
Andy
Bobby
Andy
Bobby
Andy
19
Update Andy
Bobby
Andy
Bobby
Bobby
Andy
20
Check-out
A
Bobby
Andy
21
Bobby
Andy
(Local Edit)
(Local Edit)
Bobby
Andy
22
Bobby
Andy
Bobby
Andy
23
Commit Bobby
Bobby
Andy
Andy
(Local
Conflict) Bobby
Andy
24
Andy
&
Bobby
(Local
Merge) Bobby
Andy
25
Andy
&
Bobby
Bobby
Andy
26
Andy
&
Bobby
Bobby
Andy
27
Distributed Version
tributed Version Control Control
//homes.cs.washington.edu/~mernst/advice/version-control.html
29
A A
Local Local
Repository Repository
(Andy) (Bobby)
Andy
Bobby
30
(Local Edit)
(Local Edit) Andy Bobby
A A
Local Local
Repository Repository
(Andy) (Bobby)
Andy
Bobby
31
Local Local
Repository Repository
(Andy) (Bobby)
Andy
Bobby
32
Local Local
Repository Repository
(Andy) (Bobby)
Andy
Bobby
33
Push (conflict)
Local Local
Repository Repository
(Andy) (Bobby)
Andy
Bobby
34
Distributed
tributed VersionVersion
Control Control
(6) (6)
Bobby merges the
her local files with
the files from the Remote
Repository
remote repository. (Server)
Andy
Conflicts are locally
resolved.
Pull (Fetch + Merge)
Local Local
Repository Repository
(Andy) (Bobby)
Andy
Bobby
35
Local Local
Repository Repository
(Andy) (Bobby)
Andy
Bobby
36
ributed VersionVersion
Distributed Control Control
(8) (8)
Andy pulls
(updates) the Remote
changed files Repository
(Server)
from the remote Bobby
Andy
+Andy
repository.
Pull
Local Local
Repository Repository
(Andy) (Bobby)
Andy
Bobby
37
Outline
1. Introduction
2. Versioning Models
3. Vocabulary
4. Tools
38
3. Vocabulary
• Repository (source control repository)
• A server that stores the files (documents)
• Keeps a change log
• Revision, Version
• Individual version (state) of a document that is a result of multiple
changes
• Check-Out, Clone
• Retrieves a working copy of the files from a remote repository into a
local directory
• It is possible to lock the files
39
Vocabulary
• Change
• A modification to a local file (document) that is under version
control
• Change Set / Change List
• A set of changes to multiple files that are going to be committed at
the same time
• Commit, Check-In
• Submits the changes made from the local working copy to the
repository
• Automatically creates a new version
• Conflicts may occur!
40
Vocabulary
• Conflict
• The simultaneous change to a certain file by multiple users
• Can be solved automatically and manually
• Update, Get Latest Version, Fetch / Pull
• Download the latest version of the files from the repository to a
local working directory + merge conflicting files
• Undo Check-Out, Revert / Undo Changes
• Cancels the local changes
• Restores their state from the repository
41
Vocabulary
• Merge
• Combines the changes to a file changed locally and simultaneously
in the repository
• Can be automated in most cases
• Label / Tag
• Labels mark with a name a group of files in a given version
• For example a release
• Branch / Branching
• Division of the repositories in a number of separate workflows
43
Outline
1. Introduction
2. Versioning Models
3. Vocabulary
4. Tools
44
Tools
• Central version control
• SVN (Subversion)
• TFS
• Source safe (commercial)
• Distributed version control
• Git
• Mercurial
45
What is Git?
• Git
• Distributed source-control system
• Work with local and remote repositories
• Git bash – command line interface for Git
• Free, open-source
• Has Windows version (msysGit)
• http://msysgit.github.io
• https://www.atlassian.com/git/tutorials/setting-up-a-repository
46
Installing Git
• msysGit Installation on Windows
• Download Git for Windows from: http://msysgit.github.io
• “Next, Next, Next” does the trick
• Options to select (they should be selected by default)
• “Use Git Bash only”
• “Checkout Windows-style, commit Unix-style endings”