5. Distributed Source Control
Centralized Version Control System
Central Server contains all versioned files
• Single point of failure
• Cannot work on files checked out
by someone else
6. Distributed Source Control
Distributed Version Control System
Every developer contains all versioned files and history
• Developers work offline
• Anyone can restore the project
from their local copy.
Hosted Repository
Github
bitbucket
Git
Mercurial
Bazaar
Darcs
7. Distributed Source Control
History of Git …
• Born in 2005 because commercial vendor for
bitKeeper revoked a free license from Linux
Kernel development.
• Sponsored by LinusTorvald
• Linux Kernel development uses Git
8. Distributed Source Control
History of Git - Requirements
• Fast
• Simple and easy to use
• Support for branching (thousands of parallel
branches)
• Fully distributed
• Ability to scale large projects
9. Distributed Source Control
Git Basics …
• Forget how otherVCS work
• Git stores its data as snapshots when you
commit.
• Just about every operation is local
• Everything in Git is checksummed SHA-1 hash
• You cannot lose committed changes.
10. Distributed Source Control
Git Basics …
• Committed
• Modified
• Staged
Git database (Repository)
Modify files
Checkout
S
t
a
g
e
Staging Area
11. Distributed Source Control
Git Basics – IBM Notes Designer
Git database (Repository)
Share Project – Commit changes
On disk representation
C:Program Files (x86)IBMLotusNotesDataworkspace
.NSF
12. Distributed Source Control
Domino Installation Steps
Install Git onto yourWindows PC
Install the eclipse eGit plugin into Domino Designer.
Configure Git through the eGit plugin.
Create a on-disk representation of your NSF
(extracting your NSF to the file system)
Share the on-disk representation (have Git manage
the source, a repository will be created in yet
another location.
For a detailed walk through visit
uxdesign.xpagesbeast.com
14. Distributed Source Control
Demo Steps
Open Domino Designer
Create a new Notes Application ‘git-demo’
Create on disk representation of the NSF
Share on disk representation
Check git shell $ git status, you have untracked directory
Add to repository $ git add –all, $ git status
$ git commit –am “First Commit” git
Explain the –am switch, show $ git log
15. Distributed Source Control
Demo Steps
Git add form frmDepartment
Commit
Git rm frmDepartment
Commit
Git log –p -2 show last two commits
Git log --stat to get number of lines added or removed.
Git log –pretty=oneline
Git log –pretty=format:”%h - %an, %ar :%s”
16. Distributed Source Control
Demo Steps
Difference between author and committer, the author is the
person who originally wrote the work. The committer is the one
who applied the work.
Get a list of files that changed in every commit.
Git log –pretty=format:”%h %s” –name-only
Git log –pretty=format:”%h %s %an” –name-only
Git log –since=2.hour
git log --pretty="%h:%s" --since="2013-01-01"
--before="2013-11-12" --no-merg
18. Distributed Source Control
Branching
Git starts with a default branch called master. Git stores a table
of pointers to each branch which you currently have checked out.
Git stores each set of changes into snapshots with the commit
command.
A special pointer HEAD keeps track of what branch your on.
Git branch “somename” , git checkout “somename”