Version Control
& Backups
Lecture 8
aly, ncostello
(content/slide credits Max Vogel, Hilfinger, Git Pro Book)
Why Version Control (VC)
About Git
What makes Git Special?
Git Internals
Git represents project history as directed acyclic graph of commit nodes
Nodes point (one-way) to the state they’re based on and there are no cycles
Commits correspond to project state’s tree (snapshots) which are made up of:
Branches are pointers to the head of a line of work. Default name is master (or main)
Head is a pointer to the local branch you’re currently on
Distributed: There can be many copies of a given repository, each supporting independent development, with machinery to transmit and reconcile versions between repositories.
File States
Getting Started: Creating a Repository
Walkthrough
Branching
Merging
Conflicts
<<<<<<< HEAD
[Lines of code from HEAD (i.e master)]
=======
[Lines of code from the rebasing/merge target (i.e testing, iss53, dice)]
>>>>>>> [Commit message]
Rebase
Remotes
Pushing & Pulling
$ git push <remote> <branch>
Summary: The Git Workflow
Backups
The 3-2-1 Rule
3. Have at least 3 copies of your data
2. Store your data on at least 2 different media� E.g. 1 hard drive, 1 backup server/computer
1. Have at least 1 copy of your data off-site� E.g. on Amazon S3, “the cloud,” under a mattress
What happens if you don’t follow what I said
Backup 1: Amazon S3
Backup 2: Azure Disk Snapshots
Hail Mary: LVM Snapshots
Impact
Tools for Backups
More