SlideShare una empresa de Scribd logo
1 de 46
Adnan Smajlovic
Big Cloud Solutions – DevOps Advisory
Git
Introduction and Overview
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Git repositories are not linear
– Branching already supported
•Branches are trees of trees
•Visualise
– The state of your repository as a point in a high-
dimensional „code-space‟
– Branches are represented as n-dimensional
membranes
– Map the spatial loci of successive commits onto the
projected manifold of each cloned repository
The Simple Stuff
2
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
3
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Git satire
– A Guide to Git using spatial analogies
• http://tartley.com/?p=1267
• “Tartley, you‟re one sick puppy”
Just Kidding
4
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Scope
•Background
•Features
•Services
– Github
– GitLab
– Bitbucket
•Resources
•Q&A
Agenda
5
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Scope
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Purpose
– Introduce distributed version control concept
– Generate some Git interest
• Depending on use will lead to:
– awe
– fear
– hate
– suffering
• Pass on the stories, don‟t be „that‟ guy
– Some useful concepts
• Branch, merge, rebase, amend
Scope
7
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•This is not a…
– Git tutorial
• Plenty of resources out there
– See „Resources‟ section
• Service providers and projects vary
• That said…
– If there is enough interest
• Perhaps a fully-fledged „enabler‟ tech night
• “Dude, what the hell is Jenkins and how do I integrate Git
with it?”
• What is this Selenium and SauceLabs business about?”
Scope
8
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•This is not a…
– GitHub tutorial
• There are alternatives
Scope
9
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Background
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Record changes to resources
– Not limited to software code
• e.g. Wiki article versioning
•Recall specific versions
– Revert to previous state
• File
• Image
• Project
•Tracking
– Revision numbers (e.g. 1.0.1, r3893, etc.)
Version Control - What
11
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Local
– Copy to another directory
– Patching mechanism
• Recovery based on revision sets
• “It‟s so simple” (!)
– What if?
• Forget where it is stored
• Overwrite wrong file
• Database is corrupted
• Datacentre blows up
Version Control - How
12
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Centralised
– Collaborator count > 1
– Client-server model
– Due diligence
• Auditing capabilities
– Access control
– What if?
• Network connection has high latency
• Server fails
• Datacentre blows up
Version Control - How
13
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Distributed
– Full mirror
• Clients can restore content to server
• Every copy is a backup
– Hierarchy options
• Cross-system collaboration
– What if?
• Attempt to break it
• Datacentre blo…oh, wait
Version Control - How
14
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Version Control - Who
15
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Linux kernel developers abandoned BitKeeper
– BitMover alleges reverse-engineering of protocols
– Withdraws free use
•Linus Torvalds sets out to write one
– Existing systems do not meet requirements
•Emphasis on speed
– Patch the Linux kernel tree at a set rate
•Avoid conventional approaches
– Do the opposite of what CVS did
– Name it „git‟ – Torvalds refers to himself as one (!)
Birth of Git
16
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Features
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
18
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Distributed Version Control System (DVCS)
– Fast version control
– Cheap local branching
– Easy to learn
•Arguable – some experience required to leverage the more
useful features
– Influenced by BitKeeper and Monotone concepts
•Source Code Management (SCM) principles
– Change identification via „revision number‟
• Keep an eye out for those alphanumeric strings…
Git Features
19
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Some goals
– Fast
• Must handle patching of the Linux kernel source/tree
– Fully distributed
• In case the datacentre blows up
– Simple design
• Compatibility with existing systems and protocols
– Strong non-linear development orientation
• Rapid branching and merging
• Thousands of parallel branches
Git Features
20
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Snapshots
Git Features
21
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•“Think locally not globally (!)”
– Most operations require local files/resources only
•Integrity
– Checksum all the things
•Generally only add data (apologies to Bruce Lee)
– Almost everything has an undo action
•The Three States
– Committed
– Modified
– Staged
Git Features
22
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
23
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Diverge and fix (or break) stuff
•Main line of development unaffected
•Cheap to use branches
– Writing 41 bytes to a file
– Old school methods used to copy everything :-/
•Basic merge process
– Identify best common ancestor
– Three-way merge (new snapshot)
– Merged work in a new commit object
Good to Know - Branch
24
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Good to Know - Branch
25
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Good to Know - Branch
26
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Good to Know - Branch
27
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Good to Know - Branch
28
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Things do not always go smoothly
•Merge a branch with the master
– Same object changed in multiple branches
– Attempt to merge leads to conflict
– „git status‟ shows the list of unmerged objects
– Conflicts are marked
•Pick the one you want
Good to Know - Conflicts
29
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
<<<<<<< HEAD:somefile.ext
Go away!
=======
Please go away!
>>>>>>> mybranch:somefile.ext
Good to Know - Conflicts
30
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Effectively – patching
•Process
– Grab a diff of each commit
– Store in temp files
– Reset current branch as rebase target
– Apply changes in turn
•Just one rule to remember
– “Do not rebase commits that you have pushed to a
public repository”
Good to Know - Rebase
31
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Good to Know - Rebase
32
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Good to Know - Rebase
33
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Good to Know - Rebase
34
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Rewrite history every once in a while
•“Dude, I don‟t want to look like an idiot”
•„git commit --amend‟
– Change the commit message
– Add or remove objects
•This is a mini-rebase
– Keep the perils of rebasing in mind
Good to Know - Amend
35
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Fork a repo
•Track changes in parent repo („git remote‟)
– Commits can be quickly pulled back into the fork
•Create a branch in the fork („git branch)
– Keeps the forked repo clean (see previous point)
•Modify branch and push back („git push‟)
•Test your changes
– Generally recommended unless you take rejection well
•Pull request to parent repo from your branch
Good Practice
36
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Services
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•May be referred to as “Git as a Service”
•Generally public and private repositories
•May offer multiple SCM offerings
•Additional services
– Code review
– Issue tracking
– Wiki
GaaS for the Masses
38
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Most popular source code repo site
– Social networking concepts
•Public and private repos
•Free (well…)
– Up to a point
– No private repos for the free plan
•Enterprise offering available
– Bring GitHub to your own servers
– Rackspace makes use of it
– Not exactly cheap (!)
GitHub
39
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Source code in GitHub o_0
•Free (kind of…)
– Self-hosted – you still need a server to run it on
•GitLab Cloud
– Hosted GitLab
– Unlimited private repos (10 users)
•GitLab CI
– Almost-native CI service
GitLab
40
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•Free (almost…)
– Up to 5 users
•Unlimited private repos
•Offers Mercurial support
– Start-up that was acquired
– Atlassian introduced Git support in 2011
•Enterprise offering available
– Cheaper than GitHub (at the time of writing)
•“Built for JIRA”
– Stick a #resolve in your commit message
Bitbucket
41
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Resources
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•The Git SCM book
– From the horses mouth
– Thank you for the images used in this deck
– http://git-scm.com/book
•Vogella Git Tutorial
– Lars Vogel
– http://vogella.com/articles/Git/
•Git for computer scientists
– If you‟re all about pointers
–http://eagain.net/articles/git-for-computer-scientists/
Resources
43
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
•The Git SCM tutorial
– http://git-scm.com/docs/gittutorial
•Six Revisions tutorials
–http://sixrevisions.com/resources/git-tutorials-beginners/
•Code School tutorial
– Try Git
– http://try.github.io/
Resources
44
RACKSPACE® HOSTING | WWW.RACKSPACE.COM
Questions?
46
RACKSPACE® HOSTING | © RACKSPACE US, INC. | RACKSPACE® AND FANATICAL SUPPORT® ARE SERVICE MARKS OF RACKSPACE US, INC. REGISTERED IN TH E UNITED STATES AND OTHER COUNTRIES. | WWW.RACKSPACE.CO.UK
RACKSPACE® HOSTING | 5 MILLINGTON ROAD | HAYES, UNITED KINGDOM UB3 4AZ
UK SALES: +44 (0)20 8712 6507 | UK SUPPORT: 0800 988 0300 | WWW.RACKSPACE.CO.UK

Más contenido relacionado

La actualidad más candente

MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB MeetupMariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB MeetupColin Charles
 
The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016Colin Charles
 
Meet MariaDB Server 10.1 London MySQL meetup December 2015
Meet MariaDB Server 10.1 London MySQL meetup December 2015Meet MariaDB Server 10.1 London MySQL meetup December 2015
Meet MariaDB Server 10.1 London MySQL meetup December 2015Colin Charles
 
The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015Colin Charles
 
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)Colin Charles
 
My first moments with MongoDB
My first moments with MongoDBMy first moments with MongoDB
My first moments with MongoDBColin Charles
 
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live LondonMariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live LondonIvan Zoratti
 
MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016Colin Charles
 
MySQL in the Hosted Cloud - Percona Live 2015
MySQL in the Hosted Cloud - Percona Live 2015MySQL in the Hosted Cloud - Percona Live 2015
MySQL in the Hosted Cloud - Percona Live 2015Colin Charles
 
MHA: Getting started & moving past quirks percona live santa clara 2013
MHA: Getting started & moving past quirks percona live santa clara 2013MHA: Getting started & moving past quirks percona live santa clara 2013
MHA: Getting started & moving past quirks percona live santa clara 2013Colin Charles
 
Rails - getting started
Rails - getting startedRails - getting started
Rails - getting startedTrue North
 
Essential Camel Components
Essential Camel ComponentsEssential Camel Components
Essential Camel ComponentsChristian Posta
 
Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deploymentKarthik .P.R
 
Control the Clouds - Developer Experience with jclouds.pptx
Control the Clouds - Developer Experience with jclouds.pptxControl the Clouds - Developer Experience with jclouds.pptx
Control the Clouds - Developer Experience with jclouds.pptxOpenStack Foundation
 
MariaDB: The 2012 Edition
MariaDB: The 2012 EditionMariaDB: The 2012 Edition
MariaDB: The 2012 EditionColin Charles
 
Better encryption & security with MariaDB 10.1 & MySQL 5.7
Better encryption & security with MariaDB 10.1 & MySQL 5.7Better encryption & security with MariaDB 10.1 & MySQL 5.7
Better encryption & security with MariaDB 10.1 & MySQL 5.7Colin Charles
 
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPSVMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPSVMworld
 
I A+ Open+ Source+ Secret+ Sauce
I A+ Open+ Source+ Secret+ SauceI A+ Open+ Source+ Secret+ Sauce
I A+ Open+ Source+ Secret+ Sauceguest1babda
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failuresColin Charles
 

La actualidad más candente (20)

MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB MeetupMariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
 
The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016The MySQL Server ecosystem in 2016
The MySQL Server ecosystem in 2016
 
Meet MariaDB Server 10.1 London MySQL meetup December 2015
Meet MariaDB Server 10.1 London MySQL meetup December 2015Meet MariaDB Server 10.1 London MySQL meetup December 2015
Meet MariaDB Server 10.1 London MySQL meetup December 2015
 
The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015
 
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
 
My first moments with MongoDB
My first moments with MongoDBMy first moments with MongoDB
My first moments with MongoDB
 
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live LondonMariaDB 10 Tutorial - 13.11.11 - Percona Live London
MariaDB 10 Tutorial - 13.11.11 - Percona Live London
 
MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016
 
MySQL in the Hosted Cloud - Percona Live 2015
MySQL in the Hosted Cloud - Percona Live 2015MySQL in the Hosted Cloud - Percona Live 2015
MySQL in the Hosted Cloud - Percona Live 2015
 
MHA: Getting started & moving past quirks percona live santa clara 2013
MHA: Getting started & moving past quirks percona live santa clara 2013MHA: Getting started & moving past quirks percona live santa clara 2013
MHA: Getting started & moving past quirks percona live santa clara 2013
 
Rails - getting started
Rails - getting startedRails - getting started
Rails - getting started
 
Essential Camel Components
Essential Camel ComponentsEssential Camel Components
Essential Camel Components
 
Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
 
Why MariaDB?
Why MariaDB?Why MariaDB?
Why MariaDB?
 
Control the Clouds - Developer Experience with jclouds.pptx
Control the Clouds - Developer Experience with jclouds.pptxControl the Clouds - Developer Experience with jclouds.pptx
Control the Clouds - Developer Experience with jclouds.pptx
 
MariaDB: The 2012 Edition
MariaDB: The 2012 EditionMariaDB: The 2012 Edition
MariaDB: The 2012 Edition
 
Better encryption & security with MariaDB 10.1 & MySQL 5.7
Better encryption & security with MariaDB 10.1 & MySQL 5.7Better encryption & security with MariaDB 10.1 & MySQL 5.7
Better encryption & security with MariaDB 10.1 & MySQL 5.7
 
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPSVMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
VMworld 2013: Virtualizing Mission Critical Oracle RAC with vSphere and vCOPS
 
I A+ Open+ Source+ Secret+ Sauce
I A+ Open+ Source+ Secret+ SauceI A+ Open+ Source+ Secret+ Sauce
I A+ Open+ Source+ Secret+ Sauce
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
 

Destacado

Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commandsZakaria Bouazza
 
Basic Git commands
Basic Git commandsBasic Git commands
Basic Git commandsJitendra Zaa
 
Basics About Git & GitHub
Basics About Git & GitHubBasics About Git & GitHub
Basics About Git & GitHubRaiful Hasan
 
Version control system
Version control systemVersion control system
Version control systemAndrew Liu
 
A practical approach to version control for SQL Server - By Steve Jones
A practical approach to version control for SQL Server - By Steve JonesA practical approach to version control for SQL Server - By Steve Jones
A practical approach to version control for SQL Server - By Steve JonesRed Gate Software
 

Destacado (7)

Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
Basic Git commands
Basic Git commandsBasic Git commands
Basic Git commands
 
git command
git commandgit command
git command
 
Basics About Git & GitHub
Basics About Git & GitHubBasics About Git & GitHub
Basics About Git & GitHub
 
Version control system
Version control systemVersion control system
Version control system
 
A practical approach to version control for SQL Server - By Steve Jones
A practical approach to version control for SQL Server - By Steve JonesA practical approach to version control for SQL Server - By Steve Jones
A practical approach to version control for SQL Server - By Steve Jones
 

Similar a Git - Introduction and Overview

Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutSander Temme
 
Performance_Out.pptx
Performance_Out.pptxPerformance_Out.pptx
Performance_Out.pptxsanjanabal
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Performance out
Performance outPerformance out
Performance outJack Huang
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQLDon Demcsak
 
ActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresChristian Posta
 
Performance Tuning RocksDB for Kafka Streams’ State Stores
Performance Tuning RocksDB for Kafka Streams’ State StoresPerformance Tuning RocksDB for Kafka Streams’ State Stores
Performance Tuning RocksDB for Kafka Streams’ State Storesconfluent
 
Testing at-cloud-speed sans-app-sec-austin-2013
Testing at-cloud-speed sans-app-sec-austin-2013Testing at-cloud-speed sans-app-sec-austin-2013
Testing at-cloud-speed sans-app-sec-austin-2013Matt Tesauro
 
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...confluent
 

Similar a Git - Introduction and Overview (20)

Performance out
Performance outPerformance out
Performance out
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 
Performance_Out.pptx
Performance_Out.pptxPerformance_Out.pptx
Performance_Out.pptx
 
2 7
2 72 7
2 7
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
title
titletitle
title
 
Performance out
Performance outPerformance out
Performance out
 
Performance out
Performance outPerformance out
Performance out
 
Intro to Big Data and NoSQL
Intro to Big Data and NoSQLIntro to Big Data and NoSQL
Intro to Big Data and NoSQL
 
ActiveMQ 5.9.x new features
ActiveMQ 5.9.x new featuresActiveMQ 5.9.x new features
ActiveMQ 5.9.x new features
 
Performance Tuning RocksDB for Kafka Streams’ State Stores
Performance Tuning RocksDB for Kafka Streams’ State StoresPerformance Tuning RocksDB for Kafka Streams’ State Stores
Performance Tuning RocksDB for Kafka Streams’ State Stores
 
Performance out
Performance outPerformance out
Performance out
 
Testing at-cloud-speed sans-app-sec-austin-2013
Testing at-cloud-speed sans-app-sec-austin-2013Testing at-cloud-speed sans-app-sec-austin-2013
Testing at-cloud-speed sans-app-sec-austin-2013
 
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
Performance Tuning RocksDB for Kafka Streams' State Stores (Dhruba Borthakur,...
 

Último

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Último (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Git - Introduction and Overview

  • 1. Adnan Smajlovic Big Cloud Solutions – DevOps Advisory Git Introduction and Overview
  • 2. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Git repositories are not linear – Branching already supported •Branches are trees of trees •Visualise – The state of your repository as a point in a high- dimensional „code-space‟ – Branches are represented as n-dimensional membranes – Map the spatial loci of successive commits onto the projected manifold of each cloned repository The Simple Stuff 2
  • 3. RACKSPACE® HOSTING | WWW.RACKSPACE.COM 3
  • 4. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Git satire – A Guide to Git using spatial analogies • http://tartley.com/?p=1267 • “Tartley, you‟re one sick puppy” Just Kidding 4
  • 5. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Scope •Background •Features •Services – Github – GitLab – Bitbucket •Resources •Q&A Agenda 5
  • 6. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Scope
  • 7. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Purpose – Introduce distributed version control concept – Generate some Git interest • Depending on use will lead to: – awe – fear – hate – suffering • Pass on the stories, don‟t be „that‟ guy – Some useful concepts • Branch, merge, rebase, amend Scope 7
  • 8. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •This is not a… – Git tutorial • Plenty of resources out there – See „Resources‟ section • Service providers and projects vary • That said… – If there is enough interest • Perhaps a fully-fledged „enabler‟ tech night • “Dude, what the hell is Jenkins and how do I integrate Git with it?” • What is this Selenium and SauceLabs business about?” Scope 8
  • 9. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •This is not a… – GitHub tutorial • There are alternatives Scope 9
  • 10. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Background
  • 11. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Record changes to resources – Not limited to software code • e.g. Wiki article versioning •Recall specific versions – Revert to previous state • File • Image • Project •Tracking – Revision numbers (e.g. 1.0.1, r3893, etc.) Version Control - What 11
  • 12. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Local – Copy to another directory – Patching mechanism • Recovery based on revision sets • “It‟s so simple” (!) – What if? • Forget where it is stored • Overwrite wrong file • Database is corrupted • Datacentre blows up Version Control - How 12
  • 13. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Centralised – Collaborator count > 1 – Client-server model – Due diligence • Auditing capabilities – Access control – What if? • Network connection has high latency • Server fails • Datacentre blows up Version Control - How 13
  • 14. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Distributed – Full mirror • Clients can restore content to server • Every copy is a backup – Hierarchy options • Cross-system collaboration – What if? • Attempt to break it • Datacentre blo…oh, wait Version Control - How 14
  • 15. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Version Control - Who 15
  • 16. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Linux kernel developers abandoned BitKeeper – BitMover alleges reverse-engineering of protocols – Withdraws free use •Linus Torvalds sets out to write one – Existing systems do not meet requirements •Emphasis on speed – Patch the Linux kernel tree at a set rate •Avoid conventional approaches – Do the opposite of what CVS did – Name it „git‟ – Torvalds refers to himself as one (!) Birth of Git 16
  • 17. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Features
  • 18. RACKSPACE® HOSTING | WWW.RACKSPACE.COM 18
  • 19. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Distributed Version Control System (DVCS) – Fast version control – Cheap local branching – Easy to learn •Arguable – some experience required to leverage the more useful features – Influenced by BitKeeper and Monotone concepts •Source Code Management (SCM) principles – Change identification via „revision number‟ • Keep an eye out for those alphanumeric strings… Git Features 19
  • 20. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Some goals – Fast • Must handle patching of the Linux kernel source/tree – Fully distributed • In case the datacentre blows up – Simple design • Compatibility with existing systems and protocols – Strong non-linear development orientation • Rapid branching and merging • Thousands of parallel branches Git Features 20
  • 21. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Snapshots Git Features 21
  • 22. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •“Think locally not globally (!)” – Most operations require local files/resources only •Integrity – Checksum all the things •Generally only add data (apologies to Bruce Lee) – Almost everything has an undo action •The Three States – Committed – Modified – Staged Git Features 22
  • 23. RACKSPACE® HOSTING | WWW.RACKSPACE.COM 23
  • 24. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Diverge and fix (or break) stuff •Main line of development unaffected •Cheap to use branches – Writing 41 bytes to a file – Old school methods used to copy everything :-/ •Basic merge process – Identify best common ancestor – Three-way merge (new snapshot) – Merged work in a new commit object Good to Know - Branch 24
  • 25. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Good to Know - Branch 25
  • 26. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Good to Know - Branch 26
  • 27. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Good to Know - Branch 27
  • 28. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Good to Know - Branch 28
  • 29. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Things do not always go smoothly •Merge a branch with the master – Same object changed in multiple branches – Attempt to merge leads to conflict – „git status‟ shows the list of unmerged objects – Conflicts are marked •Pick the one you want Good to Know - Conflicts 29
  • 30. RACKSPACE® HOSTING | WWW.RACKSPACE.COM <<<<<<< HEAD:somefile.ext Go away! ======= Please go away! >>>>>>> mybranch:somefile.ext Good to Know - Conflicts 30
  • 31. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Effectively – patching •Process – Grab a diff of each commit – Store in temp files – Reset current branch as rebase target – Apply changes in turn •Just one rule to remember – “Do not rebase commits that you have pushed to a public repository” Good to Know - Rebase 31
  • 32. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Good to Know - Rebase 32
  • 33. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Good to Know - Rebase 33
  • 34. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Good to Know - Rebase 34
  • 35. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Rewrite history every once in a while •“Dude, I don‟t want to look like an idiot” •„git commit --amend‟ – Change the commit message – Add or remove objects •This is a mini-rebase – Keep the perils of rebasing in mind Good to Know - Amend 35
  • 36. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Fork a repo •Track changes in parent repo („git remote‟) – Commits can be quickly pulled back into the fork •Create a branch in the fork („git branch) – Keeps the forked repo clean (see previous point) •Modify branch and push back („git push‟) •Test your changes – Generally recommended unless you take rejection well •Pull request to parent repo from your branch Good Practice 36
  • 37. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Services
  • 38. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •May be referred to as “Git as a Service” •Generally public and private repositories •May offer multiple SCM offerings •Additional services – Code review – Issue tracking – Wiki GaaS for the Masses 38
  • 39. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Most popular source code repo site – Social networking concepts •Public and private repos •Free (well…) – Up to a point – No private repos for the free plan •Enterprise offering available – Bring GitHub to your own servers – Rackspace makes use of it – Not exactly cheap (!) GitHub 39
  • 40. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Source code in GitHub o_0 •Free (kind of…) – Self-hosted – you still need a server to run it on •GitLab Cloud – Hosted GitLab – Unlimited private repos (10 users) •GitLab CI – Almost-native CI service GitLab 40
  • 41. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •Free (almost…) – Up to 5 users •Unlimited private repos •Offers Mercurial support – Start-up that was acquired – Atlassian introduced Git support in 2011 •Enterprise offering available – Cheaper than GitHub (at the time of writing) •“Built for JIRA” – Stick a #resolve in your commit message Bitbucket 41
  • 42. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Resources
  • 43. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •The Git SCM book – From the horses mouth – Thank you for the images used in this deck – http://git-scm.com/book •Vogella Git Tutorial – Lars Vogel – http://vogella.com/articles/Git/ •Git for computer scientists – If you‟re all about pointers –http://eagain.net/articles/git-for-computer-scientists/ Resources 43
  • 44. RACKSPACE® HOSTING | WWW.RACKSPACE.COM •The Git SCM tutorial – http://git-scm.com/docs/gittutorial •Six Revisions tutorials –http://sixrevisions.com/resources/git-tutorials-beginners/ •Code School tutorial – Try Git – http://try.github.io/ Resources 44
  • 45. RACKSPACE® HOSTING | WWW.RACKSPACE.COM Questions?
  • 46. 46 RACKSPACE® HOSTING | © RACKSPACE US, INC. | RACKSPACE® AND FANATICAL SUPPORT® ARE SERVICE MARKS OF RACKSPACE US, INC. REGISTERED IN TH E UNITED STATES AND OTHER COUNTRIES. | WWW.RACKSPACE.CO.UK RACKSPACE® HOSTING | 5 MILLINGTON ROAD | HAYES, UNITED KINGDOM UB3 4AZ UK SALES: +44 (0)20 8712 6507 | UK SUPPORT: 0800 988 0300 | WWW.RACKSPACE.CO.UK