Version 

Control

• FELIX VA• OFFICE OACTUARY• SOCIAL SADMINIST
Disclaimer

• The views presented here are mine and do not represe

the Social Security Administration or the Office of the Actuary within SSA.

Outline

 Benefits of Version Control Different Types of Version Control Git Sourcetree
Version Control

Practice of tracking and managing changes to software code
Traditional Version Control

 You probably use version control already Documents, Spreadsheets, Presentations, Programs Annual Projects/Reports/Scenarios “Save As..” Subfolders (2011/2013/2016) Document.ver1.doc FinalBudgetVersion_ALT2_NewAssum_2ndDemo.xlsx
Version Control Software (VCS)

A system that records changes to a file or a set of files ovethat you can recall a specific version later.

Keep Track Of:

• Who made the change• When it was made• What was the change• Why it was made
Benefits of Version Control Software

 Revert selected files back to a previous state Revert the entire project back to a previous state Compare changes over time See who last modified something Easy recovery from lost or modified files Determine why you changed something 
1st Generation VCS – Local Version Control

Dates back to 70sVery basic saving of codeSingle Computer

What if database needs to be used by several users?
2nd Generation VCS – Central Version Control

 Single Server that contains all the 

history.

 Each developer can “check out” files 

from this central server.

 Collaborate with developers on 

multiple computers.
2nd Generation VCS – Central Version Control

Examples: CVS, SVN, PTC Integrity (MKS)Advantage: All users are in sync with all other computersDisadvantage: 

 Single point of failure Only one user can work on a specific 

file
3rd Generation VCS – Distributed Version Control

 Modern version control systems that are 

widely used today

 Instead of just checking out the latest 

versions of the files; you will be fully mirroring the central server including its full history.

 Its like having you own server locally, working 

in collaboration and in sync with other servers including the central server.
3rd Generation VCS – Distributed Version Control

Examples: Git, Mercurial, etc.

Advantages:

No need of active dependency with central server Easy backup (each computer is a backup) Easy branching and merging of codeAllows multiple users to work on same file

Disadvantage:

Does not work well with binary files (non-text files such as Word, Exc

PDF...)
Git LFS (Large Files Storage)

 Extension to Git for versioning large files Works exactly the same way as Git Replaces the large files in local history as tiny 

pointer files

 They point to a separate LFS server Git handles both LFS and non-LFS files smoothlyAdvantages:

 Has all the features of git Can lock files to avoid merge conflicts
Git Workflow - Saving Changes

Bitbucket

Your Computer

Working 

Directory

Local 

Server

Central 

Server

Commit Push
Git Workflow - Update Local Computer

Bitbucket

Your Computer

Working 

Directory

Local 

Server

Central 

Server

Pull

Push
Viewing Git on Central Serv
Using Git to Save Changes

This may be hard for some 
Source

 Sourcetree is a v

interface with Git

 No CMD line req

click)

 Do need to have 

what the git comm
Benefits of Using Sourcetree

1. Process most git commands using point and click2. Easily view history of individual files3. Easily compare history at different points in time4. External Diff to compare individual files5. Blame6. Search within history7. Branch and merge8. Custom Actions
1) Point and Click
2) In

File H
3) Co

HistoBetwDifferTimep
4) Using External Diff (WinMerge) 
5) Using “Blame” 

Quickly view who and when created the code (who is to “blame” for that code)
6) Search History
7) Branching

 Best feature of Git Off to the side model Different groups can work on same 

project
Basic Branch and Merge
8) Custom Actions

Can add helpful tools that are not found in Sourcetree

 Lock files See which files are locked Download files from history View all the files from a certain point in time
Summary

 Benefits of Version Control Different Types of Version Control Git Sourcetree Use version control to travel further (Hike the Mountains)
Resources

Version Control - https://www.atlassian.com/git/tutorials/what-is-veGit - https://git-scm.comSourcetree - https://www.sourcetreeapp.com/ 
Questions?