SlideShare a Scribd company logo
Version Control
And how it will change your workflow
Key Topics
•
•
•
•

What is version control?
Why is it important?
Should I be using it?
What Version Control app should I use?
Version control started as
scratching an itch…
• It’s why we use “Save As”. You want the
new file without obliterating the old one.
It’s a common problem, and solutions are
usually like this:
– Chances are you've already rolled your own without knowing
it...
– Make a single backup copy (Document.old.txt).
– If we’re clever, we add a version number or date:
Document_V1.txt, DocumentMarch2007.txt
– We may even use a shared folder so other people can see
and edit files without sending them over email. Hopefully
they re-label the file after they save it.
Version Control to the rescue

File
Management

Team
Management

• Backup and Restore
• The Ultimate Undo
• Blame-Storming Credit!
• Sandboxing
• Synchronization
Terminology
Make with the lingo jack…

•
•
•

Repository (repo) – Database storing the files
Working Copy – Your local directory of files
Trunk / Master * – The primary location for code in the repo.

Basics
•
•
•
•
•

Add – Begin tracking with VC
Revision – What version a file is on
Head – The latest version in the repo
Checkout – Download a file from the repo
Check in - Upload to the repo
–

•
•
•

*Some systems call this main

The file gets a new version number, people can check it out

Change-log / History – List of changes to the file since it was
created in VC
Update / Sync – Synchronize your files with Head
Revert – Throw away your changes, and reload from HEAD
The Two Models

Distributed
Centralized

Bonus Question

Can anyone tell me the potential problem with using a centralized approa
to version control?
Version Control
What are my options?
VCS Name

Type

Git (the topic today)

Distributed

SVN

Centralized

Bazaar

Distributed

Mercurial

Distributed

Team Foundation
Server

Centralized

CVS (Legacy)

Rating

Centralized

Source: http://en.wikipedia.org/wiki/Comparison_of_revisoin_control_software
Cloning the Repository

Repo

mkdir ~/repository && cd repository
git clone git@github.com:chuckbutler/dotfiles
Basic Checkins
TRUNK

Milk

Milk
Bread

Milk
Bread
Eggs

Rev 1

Rev2

Rev3

echo
git
git
git

“Milk” >> list.txt
add
list.txt
commit –m “Added milk to the list”
push origin master
Checkout and Edit
TRUNK

Milk
Eggs
Juice

Revert

Check out

Milk
Eggs
Soup

Milk
Eggs
Soup

Check in
Basic Diffs
The repository has a history of changes as a file evolves. Diffs are the changes you
made while editing: imagine “peeling” them off and applying them to a file

TRUNK

Milk
R1

+Eggs

Milk
Eggs
R2

+Juic
e

Milk
Eggs
Juice

Juice
+
Soup

R3

Milk
Eggs
Soup
R4

To go from R1 to R2, we add eggs. Imagine peeling off that red sticker and placing it on R1
to get to R2.
And from R2 to R3 we add Juice, from R3 to R4 we delete Juice and add Soup
Most VCS store diffs rather than full copies of the file. This saves disk space: 4 revs of a
file doesn’t mean we have 4 copies; we have 1 copy with 4 small diffs.
Diffs help us notice changes. (“How did you fix that bug?”) and even
apply them from one branch to another. -- more on that in a second.

git rev-list --all
1bc4b508a68c4dc85873beb0836823a0799d695a
286d7c1b00a4bf408a046ccfda1e6064d6fc5960
4a5e80a2e83671de7985852a94a6c43549c4c4ab
...
Git diff 1a3a050aaf29b9411552c5a66c85698414b0611d
Note: (git uses computed hash’s for revisions)

Bonus Question: in the previous diagram, whats the diff from R1 to R4
+ Eggs
+ Soup

Notice how “Juice” wasn’t even involved – The direct jump from
R1 to R4 doesn’t need that change, since Juice was overridden
by Soup
Branching
Milk
Eggs
Soup

Milk
Eggs
Soup
Rice

R5

R6

Milk
Eggs
Soup
Bread

R7

New Feature

TRUNK

Milk
Eggs
Soup

R4

Other devs continue working, committing to trunk while you work out of your branch
We branch for our new, experimental ideas.
git branch noms
git checkout noms

Now that we have a branch, and we are working IN that branch,
we can change our code and work out the kinks. Testing in
isolation, knowing our changes wont hurt anyone, and our
branch history is under version control
It’s a tough concept for newbie's, so pretend you copied your
code into a different directory.
Merging

This step is the most daunting of all and hangs up most first-time use
Milk
Egg
s
Sou R5
Milk
p
Eggs
Soup
New Feature
R6
Rice

TRUNK
Milk
Egg
s
Sou
p

R4

Milk
Eggs
Soup
Brea
d

+Ric
e
R7

Milk
Eggs
Soup
Brea
d
R8
Rice

Re-Integration of a branch usually winds up in conflicts – this is why it
seen as difficult. You will be making good use of the diff command
git
git

branch experimental
branch

experimental
* master
git checkout experimental
(edit file)
git commit -a
git checkout master
(edit same file in master)
git commit –a
git merge experimental

We now have a conflict.
PANIC! What do I do? Relax,
grab a beer and start resolving
conflicts with git-diff
A charted example of conflicts
-Eggs
+Cheese

R3* Bob
Milk
Egg
s
Sou
p

Valid
Milk
Cheese Checkin
Juice
TRUNK

R3

-Eggs
+Hot Dog

Milk
Cheese
Juice
R4
Conflicting Checkin
(Cannot remove eggs)

R3* Judy

Milk
Hot Dog
Juice
Tagging
•

Version Control Systems support a method of easy identification
on –stable branches that we branch out of our source-tree called
“tags”

•

They are snapshots, of feature-complete code. Typically
releases.

•

To learn more about this however, you’ll have to visit the git
manpage or mr google
Milo proofs all my code

More Related Content

What's hot

Version control system
Version control systemVersion control system
Version control system
Aryman Gautam
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN Tutorial
enggHeads
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forge
Jasmine Conseil
 
SVN
SVNSVN
Subversion Best Practices
Subversion Best PracticesSubversion Best Practices
Subversion Best Practices
Matt Wood
 
Introduction to Subversion
Introduction to SubversionIntroduction to Subversion
Introduction to Subversion
Atul Jha
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
Maidul Islam
 
Evolution of deploy.sh
Evolution of deploy.shEvolution of deploy.sh
Evolution of deploy.sh
Leonid Mamchenkov
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
Mangesh Bhujbal
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overviewpolarion
 
Software Carpentry - Version control slides
Software Carpentry - Version control slidesSoftware Carpentry - Version control slides
Software Carpentry - Version control slidesanpawlik
 
Version Control System
Version Control SystemVersion Control System
Version Control System
guptaanil
 
An introduction to Atlassian Bitbucket Pipelines
An introduction to Atlassian Bitbucket PipelinesAn introduction to Atlassian Bitbucket Pipelines
An introduction to Atlassian Bitbucket Pipelines
Dave Clark
 
Revision control with subversion
Revision control with subversionRevision control with subversion
Revision control with subversion
sprocketonline
 
Dependency Management
Dependency ManagementDependency Management
Dependency Management
Alena Holligan
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version ControlWei-Tsung Su
 
Mercurial presentation
Mercurial presentationMercurial presentation
Mercurial presentation
dotNETUserGroupDnipro
 
Introduction to Distributed Version Control System with Mercurial / TortoiseHg
Introduction to Distributed Version Control System with Mercurial / TortoiseHgIntroduction to Distributed Version Control System with Mercurial / TortoiseHg
Introduction to Distributed Version Control System with Mercurial / TortoiseHg
Eng Chin Gan
 
EPAM :: LightingTalks :: Oct 2013
EPAM :: LightingTalks :: Oct 2013EPAM :: LightingTalks :: Oct 2013
EPAM :: LightingTalks :: Oct 2013
Vyacheslav Yakovenko
 
Cypress report
Cypress reportCypress report
Cypress report
Adarsh
 

What's hot (20)

Version control system
Version control systemVersion control system
Version control system
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN Tutorial
 
Part 4 - Managing your svn repository using jas forge
Part 4  - Managing your svn repository using jas forgePart 4  - Managing your svn repository using jas forge
Part 4 - Managing your svn repository using jas forge
 
SVN
SVNSVN
SVN
 
Subversion Best Practices
Subversion Best PracticesSubversion Best Practices
Subversion Best Practices
 
Introduction to Subversion
Introduction to SubversionIntroduction to Subversion
Introduction to Subversion
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
 
Evolution of deploy.sh
Evolution of deploy.shEvolution of deploy.sh
Evolution of deploy.sh
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overview
 
Software Carpentry - Version control slides
Software Carpentry - Version control slidesSoftware Carpentry - Version control slides
Software Carpentry - Version control slides
 
Version Control System
Version Control SystemVersion Control System
Version Control System
 
An introduction to Atlassian Bitbucket Pipelines
An introduction to Atlassian Bitbucket PipelinesAn introduction to Atlassian Bitbucket Pipelines
An introduction to Atlassian Bitbucket Pipelines
 
Revision control with subversion
Revision control with subversionRevision control with subversion
Revision control with subversion
 
Dependency Management
Dependency ManagementDependency Management
Dependency Management
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
Mercurial presentation
Mercurial presentationMercurial presentation
Mercurial presentation
 
Introduction to Distributed Version Control System with Mercurial / TortoiseHg
Introduction to Distributed Version Control System with Mercurial / TortoiseHgIntroduction to Distributed Version Control System with Mercurial / TortoiseHg
Introduction to Distributed Version Control System with Mercurial / TortoiseHg
 
EPAM :: LightingTalks :: Oct 2013
EPAM :: LightingTalks :: Oct 2013EPAM :: LightingTalks :: Oct 2013
EPAM :: LightingTalks :: Oct 2013
 
Cypress report
Cypress reportCypress report
Cypress report
 

Similar to Source Code Management Slides

Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version ControlNowell Strite
 
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Revelation Technologies
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching model
Pavlo Hodysh
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
drupalindia
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego League
Jeffrey T. Pollock
 
SVN Information
SVN Information  SVN Information
SVN Information
RAHUL TRIPATHI
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
Alex Hillman
 
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
hamidsamadi
 
Version control
Version controlVersion control
Version control
Shahriar Iqbal Chowdhury
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
Yeasin Abedin
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLab
Pablo Arriazu
 
Git
GitGit
[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git
Ivano Malavolta
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps Jumpstart
Ori Donner
 
Subversion
SubversionSubversion
Subversion
Vaibhav Sakhalkar
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Callon Campbell
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Andrew Bayer
 
Subversion
SubversionSubversion
Subversionrchakra
 
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBAKoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
Tobias Koprowski
 
Version control
Version controlVersion control
Version control
Sean Hayes
 

Similar to Source Code Management Slides (20)

Embracing Distributed Version Control
Embracing Distributed Version ControlEmbracing Distributed Version Control
Embracing Distributed Version Control
 
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)Version Uncontrolled - How to Manage Your Version Control (whitepaper)
Version Uncontrolled - How to Manage Your Version Control (whitepaper)
 
Git and GitFlow branching model
Git and GitFlow branching modelGit and GitFlow branching model
Git and GitFlow branching model
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego League
 
SVN Information
SVN Information  SVN Information
SVN Information
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
 
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
Git workflows á la-carte, Presenation at jdays2013 www.jdays.se by Nicola Pao...
 
Version control
Version controlVersion control
Version control
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLab
 
Git
GitGit
Git
 
[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git[2015/2016] Collaborative software development with Git
[2015/2016] Collaborative software development with Git
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps Jumpstart
 
Subversion
SubversionSubversion
Subversion
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
Subversion
SubversionSubversion
Subversion
 
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBAKoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
 
Version control
Version controlVersion control
Version control
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Source Code Management Slides

  • 1. Version Control And how it will change your workflow
  • 2. Key Topics • • • • What is version control? Why is it important? Should I be using it? What Version Control app should I use?
  • 3. Version control started as scratching an itch… • It’s why we use “Save As”. You want the new file without obliterating the old one. It’s a common problem, and solutions are usually like this: – Chances are you've already rolled your own without knowing it... – Make a single backup copy (Document.old.txt). – If we’re clever, we add a version number or date: Document_V1.txt, DocumentMarch2007.txt – We may even use a shared folder so other people can see and edit files without sending them over email. Hopefully they re-label the file after they save it.
  • 4. Version Control to the rescue File Management Team Management • Backup and Restore • The Ultimate Undo • Blame-Storming Credit! • Sandboxing • Synchronization
  • 5. Terminology Make with the lingo jack… • • • Repository (repo) – Database storing the files Working Copy – Your local directory of files Trunk / Master * – The primary location for code in the repo. Basics • • • • • Add – Begin tracking with VC Revision – What version a file is on Head – The latest version in the repo Checkout – Download a file from the repo Check in - Upload to the repo – • • • *Some systems call this main The file gets a new version number, people can check it out Change-log / History – List of changes to the file since it was created in VC Update / Sync – Synchronize your files with Head Revert – Throw away your changes, and reload from HEAD
  • 6. The Two Models Distributed Centralized Bonus Question Can anyone tell me the potential problem with using a centralized approa to version control?
  • 7. Version Control What are my options? VCS Name Type Git (the topic today) Distributed SVN Centralized Bazaar Distributed Mercurial Distributed Team Foundation Server Centralized CVS (Legacy) Rating Centralized Source: http://en.wikipedia.org/wiki/Comparison_of_revisoin_control_software
  • 8. Cloning the Repository Repo mkdir ~/repository && cd repository git clone git@github.com:chuckbutler/dotfiles
  • 9. Basic Checkins TRUNK Milk Milk Bread Milk Bread Eggs Rev 1 Rev2 Rev3 echo git git git “Milk” >> list.txt add list.txt commit –m “Added milk to the list” push origin master
  • 10. Checkout and Edit TRUNK Milk Eggs Juice Revert Check out Milk Eggs Soup Milk Eggs Soup Check in
  • 11. Basic Diffs The repository has a history of changes as a file evolves. Diffs are the changes you made while editing: imagine “peeling” them off and applying them to a file TRUNK Milk R1 +Eggs Milk Eggs R2 +Juic e Milk Eggs Juice Juice + Soup R3 Milk Eggs Soup R4 To go from R1 to R2, we add eggs. Imagine peeling off that red sticker and placing it on R1 to get to R2. And from R2 to R3 we add Juice, from R3 to R4 we delete Juice and add Soup Most VCS store diffs rather than full copies of the file. This saves disk space: 4 revs of a file doesn’t mean we have 4 copies; we have 1 copy with 4 small diffs.
  • 12. Diffs help us notice changes. (“How did you fix that bug?”) and even apply them from one branch to another. -- more on that in a second. git rev-list --all 1bc4b508a68c4dc85873beb0836823a0799d695a 286d7c1b00a4bf408a046ccfda1e6064d6fc5960 4a5e80a2e83671de7985852a94a6c43549c4c4ab ... Git diff 1a3a050aaf29b9411552c5a66c85698414b0611d Note: (git uses computed hash’s for revisions) Bonus Question: in the previous diagram, whats the diff from R1 to R4 + Eggs + Soup Notice how “Juice” wasn’t even involved – The direct jump from R1 to R4 doesn’t need that change, since Juice was overridden by Soup
  • 14. We branch for our new, experimental ideas. git branch noms git checkout noms Now that we have a branch, and we are working IN that branch, we can change our code and work out the kinks. Testing in isolation, knowing our changes wont hurt anyone, and our branch history is under version control It’s a tough concept for newbie's, so pretend you copied your code into a different directory.
  • 15. Merging This step is the most daunting of all and hangs up most first-time use Milk Egg s Sou R5 Milk p Eggs Soup New Feature R6 Rice TRUNK Milk Egg s Sou p R4 Milk Eggs Soup Brea d +Ric e R7 Milk Eggs Soup Brea d R8 Rice Re-Integration of a branch usually winds up in conflicts – this is why it seen as difficult. You will be making good use of the diff command
  • 16. git git branch experimental branch experimental * master git checkout experimental (edit file) git commit -a git checkout master (edit same file in master) git commit –a git merge experimental We now have a conflict. PANIC! What do I do? Relax, grab a beer and start resolving conflicts with git-diff
  • 17. A charted example of conflicts -Eggs +Cheese R3* Bob Milk Egg s Sou p Valid Milk Cheese Checkin Juice TRUNK R3 -Eggs +Hot Dog Milk Cheese Juice R4 Conflicting Checkin (Cannot remove eggs) R3* Judy Milk Hot Dog Juice
  • 18. Tagging • Version Control Systems support a method of easy identification on –stable branches that we branch out of our source-tree called “tags” • They are snapshots, of feature-complete code. Typically releases. • To learn more about this however, you’ll have to visit the git manpage or mr google
  • 19. Milo proofs all my code