SlideShare a Scribd company logo
1 of 37
GIT 201 - A DEEPER LOOK AT GIT
Git Me With Your Best Shot
Arthur Doler
@arthurdoler
arthurdoler@gmail.com
Weā€™ll be using the Git
command lineā€¦
Source: Giphy
ā€œFUNDAMENTAL PARTICLESā€ OF GIT
Blob
artdoler@machine$ git ls-files --stage
100644 ac461d89cb0a217c2ee2bfcac33e1c27df7739a7 0 path/to/source/file.js
Tree
artdoler@machine$ git write-tree
cf09c37fdb1e4ba320d2ae08e9eb32d6913979e3
artdoler@machine$ git ls-tree cf09
040000 tree c98ef89a1fc979e593927666c058d15f8111c0bf path
Commit
artdoler@machine$ echo "Manual commit." | git commit-tree cf09
c26db2aec27b78aeaed82173ec5f5b2303931b29
artdoler@machine$ git log c26d
commit c26db2aec27b78aeaed82173ec5f5b2303931b29
Author: Art Doler art.doler@aviture.us.com
Date: Thu May 20 08:59:12 2016 -0500
Manual commit.
A GIT REPOSITORY
IS JUST GRAPHS OF COMMITS
What Git Manages For You
What To Actually Think About
Blob
Tree
Commit
Ī”
Ī”
Ī”
Ī”
Ī”
Ī”
Ī”
Ī”
Ī”Ī”
Ī”
Ī”
Ī”
HOW DOES GIT MAKE DIFFS?
B
C
F
E
A
Commit 1 Commit 2
Directory Directory
Rename
Delete
Edit
Add
BRANCHES & TAGS
When I realize ā€œDVCSā€ means I always get my own
branch
Source: Giphy
WHATā€™S IN A NAME?
HEAD
ac461d89cb0a217c2ee2bfcac33e1c27df7739a7
feature/my_feature_branch
^ ~
B = A^ = A~ = A^1 = A~1
A
B
A = A^0
C
C = B^ = A^^ = A~~
C = A^1^1 = A~2
C ā‰  A^2
develop
MERGING
When my coworkerā€™s merge breaks my
feature
Source: Giphy
B = A^ = A~ = A^1 = A~1
A
B
A = A^0
C
D E
D = C^1 = C~ = B~2
develop
E = C^2 = B^^2 = A~2^2
develop branch_2
F G
F = C^^ = A~4
G = E~ = C^2^ = A~2^2~
C = B^ = A^^ = A~~
C = A^1^1 = A~2
C ā‰  A^2
OPINION TIME
Source: Giphy
IF THE BEST WAY TO THINK ABOUT GIT
IS COMMIT TOPOLOGIESā€¦
ONE CONCEPT, ONE COMMIT
ā€œI don't know how many people
look at Al's progression of patches,
but they are stand-alone patches
on their own, while at the same
time _also_ being part of a larger
migration to the inscrutable goals
of Al - ie namespaces etc.
You may not realize just _how_
impressive that is, and what a
absolute wonder it is to work with
the guy.
Poetry in patches, indeed.ā€
- Linus Torvalds
On fa.linux.kernel, 27 Dec 2001
Source: Wikipedia
CLEAN CODE ā†” CLEAN HISTORY
PICK ā€œTOO MANY COMMITSā€
OVER ā€œTOO FEWā€
ā€œHistory is the version of past events
that people have decided to agree
upon.ā€
- Attr. Napoleon Bonaparte
Source: Wikipedia
REBASING
When you learn to rebase like a boss
Source: Giphy
PUBLIC VERSUS PRIVATE BRANCHES
When you force push to
a
public branch
Source: Giphy
GARBAGE COLLECTION
Finding out git has a garbage collector
when it deletes your accidentally untracked
Source: Giphy
HISTORY METHODOLOGIES
Pure Merge (i.e. gitflow)
Pure Rebase (Keep Branch or Delete Branch)
Rebase Then Merge
Rebase With Squash (Mild/Major)
ā€¦ A
D
E
F
Example Case: Feature
Develop
ā€¦ B
F
Pure Merge
ā€¦
A
C D
E
G
Develop
Feature
ā€¦
B
Pure Rebase
(Keep or Delete Branch)
ā€¦
A
B C
D
Develop
Feature
Rebase Then Merge
ā€¦
A
C D
E
Develop
Feature
ā€¦
B
F
ā€¦
A
B D
E
Develop
FeatureF
Rebase With Squash
QUESTIONS?
When I accidentally
click ā€˜Merge pull
requestā€™ instead of
ā€˜Commentā€™ in GitHub
Source: Giphy
ā€¢Do you live in the Omaha/Lincoln area?
ā€¢Do you work in development or in another
profession in tech?
ā€¢Are you a consumer of mental health services or
have you been diagnosed with a mental disorder?
ā€¢Are you interested in being a founding member of a
peer-support group for technical mental health
consumers?
Talk to me afterward, or email me at
arthurdoler@gmail.com
(or Twitter DM or LinkedIn message or G+
RESOURCES
ā€¢ Git from the Bottom Up (free!)
ā€¢ http://ftp.newartisans.com/pub/git.from.bottom.up.pdf
ā€¢ Gitflow
ā€¢ http://nvie.com/posts/a-successful-git-branching-model/
ā€¢ A Git Workflow for Agile Teams
ā€¢ http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html
ā€¢ Git Team Workflows: merge or rebase?
ā€¢ http://blogs.atlassian.com/2013/10/git-team-workflows-merge-or-rebas
ā€¢ Git Pro Book (also free!)
ā€¢ http://git-scm.com/book
ā€¢ Git pack files
ā€¢ http://git-scm.com/book/en/Git-Internals-Packfiles
ā€¢ http://stackoverflow.com/questions/5176225/are-gits-pack-files-deltas-r

More Related Content

Viewers also liked

The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of GitDivineOmega
Ā 
#4 - Git - Stash
#4 - Git - Stash#4 - Git - Stash
#4 - Git - StashRodrigo Branas
Ā 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messesKatie Sylor-Miller
Ā 
Gibbering about git - managing your source code made easy
Gibbering about git - managing your source code made easyGibbering about git - managing your source code made easy
Gibbering about git - managing your source code made easyMadeleine Schƶnemann
Ā 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not AppsNatasha Murashev
Ā 

Viewers also liked (8)

The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
Ā 
#4 - Git - Stash
#4 - Git - Stash#4 - Git - Stash
#4 - Git - Stash
Ā 
Git advanced
Git advancedGit advanced
Git advanced
Ā 
GIT Fundamentals
GIT FundamentalsGIT Fundamentals
GIT Fundamentals
Ā 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
Ā 
Gibbering about git - managing your source code made easy
Gibbering about git - managing your source code made easyGibbering about git - managing your source code made easy
Gibbering about git - managing your source code made easy
Ā 
Git Branching Model
Git Branching ModelGit Branching Model
Git Branching Model
Ā 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
Ā 

Similar to Git 201: A Deeper Look at Git (Nebraska.Code 2016)

Git 201 - A Deeper Look at Git @ Prairie.Code() 2016
Git 201 - A Deeper Look at Git @ Prairie.Code() 2016Git 201 - A Deeper Look at Git @ Prairie.Code() 2016
Git 201 - A Deeper Look at Git @ Prairie.Code() 2016Arthur Doler
Ā 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopAll Things Open
Ā 
Git branching model_for_tap_team
Git branching model_for_tap_teamGit branching model_for_tap_team
Git branching model_for_tap_teamGrzegorz Wilczynski
Ā 
slides.pdf
slides.pdfslides.pdf
slides.pdfvidsvagi
Ā 
That's (g)it! par SĆ©bastien Dawans CETIC
That's (g)it! par SĆ©bastien Dawans CETICThat's (g)it! par SĆ©bastien Dawans CETIC
That's (g)it! par SĆ©bastien Dawans CETICLa FeWeb
Ā 
Working with Git
Working with GitWorking with Git
Working with GitPete Nicholls
Ā 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-DevelopersAll Things Open
Ā 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-DevelopersJohn Anderson
Ā 
Git the Docs: Learning Git in a safe space
Git the Docs: Learning Git in a safe spaceGit the Docs: Learning Git in a safe space
Git the Docs: Learning Git in a safe spaceBecky Todd
Ā 
Git Basic
Git BasicGit Basic
Git BasicLuke Luo
Ā 
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]Carina C. Zona
Ā 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginnersbryanbibat
Ā 
git session --interactive
git session --interactivegit session --interactive
git session --interactiveMarius Colacioiu
Ā 
An introduction to Git with Atlassian Suite
An introduction to Git with Atlassian SuiteAn introduction to Git with Atlassian Suite
An introduction to Git with Atlassian SuiteChetan Khatri
Ā 

Similar to Git 201: A Deeper Look at Git (Nebraska.Code 2016) (20)

Git 201 - A Deeper Look at Git @ Prairie.Code() 2016
Git 201 - A Deeper Look at Git @ Prairie.Code() 2016Git 201 - A Deeper Look at Git @ Prairie.Code() 2016
Git 201 - A Deeper Look at Git @ Prairie.Code() 2016
Ā 
Version Control and Git - GitHub Workshop
Version Control and Git - GitHub WorkshopVersion Control and Git - GitHub Workshop
Version Control and Git - GitHub Workshop
Ā 
Git branching model_for_tap_team
Git branching model_for_tap_teamGit branching model_for_tap_team
Git branching model_for_tap_team
Ā 
slides.pdf
slides.pdfslides.pdf
slides.pdf
Ā 
slides.pdf
slides.pdfslides.pdf
slides.pdf
Ā 
git & GitHub workshop
git & GitHub workshopgit & GitHub workshop
git & GitHub workshop
Ā 
That's (g)it! par SĆ©bastien Dawans CETIC
That's (g)it! par SĆ©bastien Dawans CETICThat's (g)it! par SĆ©bastien Dawans CETIC
That's (g)it! par SĆ©bastien Dawans CETIC
Ā 
Working with Git
Working with GitWorking with Git
Working with Git
Ā 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-Developers
Ā 
Introduction to Git for Non-Developers
Introduction to Git for Non-DevelopersIntroduction to Git for Non-Developers
Introduction to Git for Non-Developers
Ā 
Git the Docs: Learning Git in a safe space
Git the Docs: Learning Git in a safe spaceGit the Docs: Learning Git in a safe space
Git the Docs: Learning Git in a safe space
Ā 
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
Ā 
Git Without Puns
Git Without PunsGit Without Puns
Git Without Puns
Ā 
Git Basic
Git BasicGit Basic
Git Basic
Ā 
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
Cool Git Tricks (That I Learn When Things Go Badly) [1/2]
Ā 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
Ā 
Git
GitGit
Git
Ā 
git session --interactive
git session --interactivegit session --interactive
git session --interactive
Ā 
An introduction to Git with Atlassian Suite
An introduction to Git with Atlassian SuiteAn introduction to Git with Atlassian Suite
An introduction to Git with Atlassian Suite
Ā 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
Ā 

More from Arthur Doler

The Saboteur in Your Retrospectives: Handout
The Saboteur in Your Retrospectives: HandoutThe Saboteur in Your Retrospectives: Handout
The Saboteur in Your Retrospectives: HandoutArthur Doler
Ā 
The Developer's Guide to Learning
The Developer's Guide to LearningThe Developer's Guide to Learning
The Developer's Guide to LearningArthur Doler
Ā 
The Whys and Hows of Impostor Syndrome and the Illusion of Transparency
The Whys and Hows of Impostor Syndrome and the Illusion of TransparencyThe Whys and Hows of Impostor Syndrome and the Illusion of Transparency
The Whys and Hows of Impostor Syndrome and the Illusion of TransparencyArthur Doler
Ā 
Let's Talk About Mental Health Handout
Let's Talk About Mental Health HandoutLet's Talk About Mental Health Handout
Let's Talk About Mental Health HandoutArthur Doler
Ā 
Let's Talk About Mental Health
Let's Talk About Mental HealthLet's Talk About Mental Health
Let's Talk About Mental HealthArthur Doler
Ā 
Feedback Workshop KCDC2018
Feedback Workshop KCDC2018Feedback Workshop KCDC2018
Feedback Workshop KCDC2018Arthur Doler
Ā 
Let's Talk About Mental Health - KCDC 2018
Let's Talk About Mental Health - KCDC 2018Let's Talk About Mental Health - KCDC 2018
Let's Talk About Mental Health - KCDC 2018Arthur Doler
Ā 
Let's Talk About Mental Health Handout - KCDC 2018
Let's Talk About Mental Health Handout - KCDC 2018Let's Talk About Mental Health Handout - KCDC 2018
Let's Talk About Mental Health Handout - KCDC 2018Arthur Doler
Ā 
Let's Talk About Mental Health Handout - NDC Oslo 2018
Let's Talk About Mental Health Handout - NDC Oslo 2018Let's Talk About Mental Health Handout - NDC Oslo 2018
Let's Talk About Mental Health Handout - NDC Oslo 2018Arthur Doler
Ā 
Let's Talk About Mental Health - NDC Oslo 2018
Let's Talk About Mental Health - NDC Oslo 2018Let's Talk About Mental Health - NDC Oslo 2018
Let's Talk About Mental Health - NDC Oslo 2018Arthur Doler
Ā 
Let's Talk About Mental Health Handout - Nebraska.Code 2018
Let's Talk About Mental Health Handout - Nebraska.Code 2018Let's Talk About Mental Health Handout - Nebraska.Code 2018
Let's Talk About Mental Health Handout - Nebraska.Code 2018Arthur Doler
Ā 
Let's Talk About Mental Health - Nebraska.Code 2018
Let's Talk About Mental Health - Nebraska.Code 2018Let's Talk About Mental Health - Nebraska.Code 2018
Let's Talk About Mental Health - Nebraska.Code 2018Arthur Doler
Ā 
The Developer's Guide to Learning - 200OK 2018
The Developer's Guide to Learning - 200OK 2018The Developer's Guide to Learning - 200OK 2018
The Developer's Guide to Learning - 200OK 2018Arthur Doler
Ā 
The Developer's Guide to Learning - Codestock 2018
The Developer's Guide to Learning - Codestock 2018The Developer's Guide to Learning - Codestock 2018
The Developer's Guide to Learning - Codestock 2018Arthur Doler
Ā 
What Makes You DO Stuff? The Psychology of Motivation - Codestock 2018
What Makes You DO Stuff? The Psychology of Motivation - Codestock 2018What Makes You DO Stuff? The Psychology of Motivation - Codestock 2018
What Makes You DO Stuff? The Psychology of Motivation - Codestock 2018Arthur Doler
Ā 
What Makes You DO Stuff? The Psychology of Motivation - Handout - Codestock 2018
What Makes You DO Stuff? The Psychology of Motivation - Handout - Codestock 2018What Makes You DO Stuff? The Psychology of Motivation - Handout - Codestock 2018
What Makes You DO Stuff? The Psychology of Motivation - Handout - Codestock 2018Arthur Doler
Ā 
Let's Talk About Mental Health - DevUp 2017
Let's Talk About Mental Health - DevUp 2017Let's Talk About Mental Health - DevUp 2017
Let's Talk About Mental Health - DevUp 2017Arthur Doler
Ā 
Let's Talk About Mental Health - Handout - DevUp 2017
Let's Talk About Mental Health - Handout - DevUp 2017Let's Talk About Mental Health - Handout - DevUp 2017
Let's Talk About Mental Health - Handout - DevUp 2017Arthur Doler
Ā 
The Developer's Guide to Learning Effectively
The Developer's Guide to Learning EffectivelyThe Developer's Guide to Learning Effectively
The Developer's Guide to Learning EffectivelyArthur Doler
Ā 
The Saboteur in Your Retrospectives: How Your Brain Works Against You - The H...
The Saboteur in Your Retrospectives: How Your Brain Works Against You - The H...The Saboteur in Your Retrospectives: How Your Brain Works Against You - The H...
The Saboteur in Your Retrospectives: How Your Brain Works Against You - The H...Arthur Doler
Ā 

More from Arthur Doler (20)

The Saboteur in Your Retrospectives: Handout
The Saboteur in Your Retrospectives: HandoutThe Saboteur in Your Retrospectives: Handout
The Saboteur in Your Retrospectives: Handout
Ā 
The Developer's Guide to Learning
The Developer's Guide to LearningThe Developer's Guide to Learning
The Developer's Guide to Learning
Ā 
The Whys and Hows of Impostor Syndrome and the Illusion of Transparency
The Whys and Hows of Impostor Syndrome and the Illusion of TransparencyThe Whys and Hows of Impostor Syndrome and the Illusion of Transparency
The Whys and Hows of Impostor Syndrome and the Illusion of Transparency
Ā 
Let's Talk About Mental Health Handout
Let's Talk About Mental Health HandoutLet's Talk About Mental Health Handout
Let's Talk About Mental Health Handout
Ā 
Let's Talk About Mental Health
Let's Talk About Mental HealthLet's Talk About Mental Health
Let's Talk About Mental Health
Ā 
Feedback Workshop KCDC2018
Feedback Workshop KCDC2018Feedback Workshop KCDC2018
Feedback Workshop KCDC2018
Ā 
Let's Talk About Mental Health - KCDC 2018
Let's Talk About Mental Health - KCDC 2018Let's Talk About Mental Health - KCDC 2018
Let's Talk About Mental Health - KCDC 2018
Ā 
Let's Talk About Mental Health Handout - KCDC 2018
Let's Talk About Mental Health Handout - KCDC 2018Let's Talk About Mental Health Handout - KCDC 2018
Let's Talk About Mental Health Handout - KCDC 2018
Ā 
Let's Talk About Mental Health Handout - NDC Oslo 2018
Let's Talk About Mental Health Handout - NDC Oslo 2018Let's Talk About Mental Health Handout - NDC Oslo 2018
Let's Talk About Mental Health Handout - NDC Oslo 2018
Ā 
Let's Talk About Mental Health - NDC Oslo 2018
Let's Talk About Mental Health - NDC Oslo 2018Let's Talk About Mental Health - NDC Oslo 2018
Let's Talk About Mental Health - NDC Oslo 2018
Ā 
Let's Talk About Mental Health Handout - Nebraska.Code 2018
Let's Talk About Mental Health Handout - Nebraska.Code 2018Let's Talk About Mental Health Handout - Nebraska.Code 2018
Let's Talk About Mental Health Handout - Nebraska.Code 2018
Ā 
Let's Talk About Mental Health - Nebraska.Code 2018
Let's Talk About Mental Health - Nebraska.Code 2018Let's Talk About Mental Health - Nebraska.Code 2018
Let's Talk About Mental Health - Nebraska.Code 2018
Ā 
The Developer's Guide to Learning - 200OK 2018
The Developer's Guide to Learning - 200OK 2018The Developer's Guide to Learning - 200OK 2018
The Developer's Guide to Learning - 200OK 2018
Ā 
The Developer's Guide to Learning - Codestock 2018
The Developer's Guide to Learning - Codestock 2018The Developer's Guide to Learning - Codestock 2018
The Developer's Guide to Learning - Codestock 2018
Ā 
What Makes You DO Stuff? The Psychology of Motivation - Codestock 2018
What Makes You DO Stuff? The Psychology of Motivation - Codestock 2018What Makes You DO Stuff? The Psychology of Motivation - Codestock 2018
What Makes You DO Stuff? The Psychology of Motivation - Codestock 2018
Ā 
What Makes You DO Stuff? The Psychology of Motivation - Handout - Codestock 2018
What Makes You DO Stuff? The Psychology of Motivation - Handout - Codestock 2018What Makes You DO Stuff? The Psychology of Motivation - Handout - Codestock 2018
What Makes You DO Stuff? The Psychology of Motivation - Handout - Codestock 2018
Ā 
Let's Talk About Mental Health - DevUp 2017
Let's Talk About Mental Health - DevUp 2017Let's Talk About Mental Health - DevUp 2017
Let's Talk About Mental Health - DevUp 2017
Ā 
Let's Talk About Mental Health - Handout - DevUp 2017
Let's Talk About Mental Health - Handout - DevUp 2017Let's Talk About Mental Health - Handout - DevUp 2017
Let's Talk About Mental Health - Handout - DevUp 2017
Ā 
The Developer's Guide to Learning Effectively
The Developer's Guide to Learning EffectivelyThe Developer's Guide to Learning Effectively
The Developer's Guide to Learning Effectively
Ā 
The Saboteur in Your Retrospectives: How Your Brain Works Against You - The H...
The Saboteur in Your Retrospectives: How Your Brain Works Against You - The H...The Saboteur in Your Retrospectives: How Your Brain Works Against You - The H...
The Saboteur in Your Retrospectives: How Your Brain Works Against You - The H...
Ā 

Recently uploaded

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
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationRadu Cotescu
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
Ā 
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
Ā 
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
Ā 
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
Ā 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
Ā 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
Ā 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...gurkirankumar98700
Ā 
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
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
Ā 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
Ā 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
Ā 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
Ā 
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
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
Ā 

Recently uploaded (20)

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...
Ā 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Ā 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
Ā 
Scaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organizationScaling API-first ā€“ The story of a global engineering organization
Scaling API-first ā€“ The story of a global engineering organization
Ā 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Ā 
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
Ā 
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
Ā 
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 āœ“Call Girls In Kalyan ( Mumbai ) secure service
Ā 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Ā 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
Ā 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service šŸø 8923113531 šŸŽ° Avail...
Ā 
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
Ā 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
Ā 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
Ā 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
Ā 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Ā 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
Ā 
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
Ā 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
Ā 

Git 201: A Deeper Look at Git (Nebraska.Code 2016)

Editor's Notes

  1. A quick overview of the basic structure for git ā€“ blobs are contained by trees, which contain each other, and which are contained by a commit. Blobs and trees are subatomic particles, composing the literally atomic commits. Like reality, almost all of the time, just knowing how atoms work is enough. Sometimes thereā€™s effects that make no sense which require subatomic knowledge, but until those points itā€™s not necessary.
  2. Commits and commit topologies are the most important pieces of Git. The ā€œatomicā€ commits form into ā€œmoleculesā€ of topologies (typically called branches). The edges of the DAG are then the deltas.
  3. Here we have two commits, side by side, and weā€™re going to try to get a diff between the two. Commit 1 has three files ā€“ one in the root of the repo (File 1) and two in a directory (helpfully called Directory), which are File 3 and File 4. Commit 2 has three files ā€“ File 2 in the root and File 4 and File 5 in Directory. File 1 and 2 have the same blob: identically the same. Git will (sometimes) reinterpret this as a rename. File 3 is in Commit 1 but not in Commit 2, so itā€™s a delete. File 4 has different blobs in the two commits: itā€™s a change and a diff will be generated. File 5 is in Commit 2 but not in Commit 1: itā€™s an add.
  4. Time to go to the command line. Explain what youā€™re doing ā€“ committing data to be served via a service. In this case, MTG decks. Magic has different ways to play it, called ā€œformatsā€. Weā€™re tracking formats in different branches, because Reasons. New tournament ā€“ block format! So ā€œgit checkout ā€“b mtg_2014_blockā€ There are uncommitted changes, so ā€œgit add .ā€ then ā€œgit commit ā€“m ā€œNew decks.ā€ā€ Talk about what a branch is ā€“ a pointer to a specific commit. A major tournament is over so weā€™re making a tag for it. ā€œgit tag ā€“a SCG_Open_07_2014 ā€“m ā€œSCG Open Finalized Decks.ā€ā€ Lightweight tags are just like (mostly) immutable branches. Annotated tags identify the tagger, the message, the date, and have a checksum. Talk about how a branch is actually a pointer to the entire DAG (directed acyclical graph) at that point. Two important things to realize: A branch is not constrained by anything ā€“ any branch can point to any commit (even HEAD or master!). The hash for each commit includes its parent ā€“ that means ANY history change will cascade through the DAG! Weā€™ll see an example when we rebase.
  5. Different ways to get upstream in your repositoryā€¦ note that these work on ANY name for a commit! And they can be chained, like in the last example, since the valid names for a commit (sha1, tag, branch, etc) plus the ^ and ~ operators are a valid DSL.
  6. Anything valid in block format is valid in standard format, and so we need to merge those commits in: ā€œgit checkout mtg_2014_standardā€, ā€œgit merge --no-ff mtg_2014_blockā€ The ā€œno-ffā€ option on a merge performs a guaranteed merge commit ā€“ by default git will try to avoid making a merge commit if it can, through doing what is basically a rebase. ā€“no-ff forces it to make a merge commit instead.
  7. Different ways to get upstream in your repositoryā€¦ note that these work on ANY name for a commit! And they can be chained, like in the last example, since the valid names for a commit (sha1, tag, branch, etc) plus the ^ and ~ operators are a valid DSL.
  8. Example time yet again. We have a repo. Weā€™ve been doing on-the-ground reporting for a local tournament and weā€™ve made a bunch of commits as we went so we didnā€™t lose anything. Could push this, but it looks terrible. What to do? Rebase! Interactive rebase ā€“ git pops open whatever editor we have configured. One row = one commit, in reverse order. It does this in an editor so you can copy and paste, and so you can change the command from ā€œpickā€ to something else. Show the list in gvim next to the list in gitviz. There is one reorder, then two fixups, then one commit to reword and one commit to amend. What if there had been commits on block we had to worry about? Rebase to the rescue! Normal rebase. Call out how it applies each commit in turn. We could have done both at once (and we should have!) but I broke it apart for clarity.
  9. Example time again. git branch ā€“D mtg_2014_legacy ./gcscript.sh See!
  10. A discussion of git workflows ā€“ Iā€™m going to exclude the issues caused by external tools here and focus only on git. It ā€“ essentially ā€“ boils down to four types of git workflows. Weā€™ll work through the same example with each of the four types ā€“ just as a visual, to avoid a lot of unnecessary typing.
  11. ā€œPure ā€œ merge ā€“ using only the merge command (with --no-ff option). First merge develop into the feature to get the changes from Feature Branch B, accounting for conflicts if necessary. Then merge the feature branch into develop.
  12. ā€œPureā€ rebase ā€“ First rebase the feature branch onto current develop to pick up branch Bā€™s changes. Then alter developā€™s head ref to point to F, either via manually editing it (bad!) or a fast-forward merge.
  13. Rebase then merge ā€“ First rebase the feature branch onto current develop to pick up branch Bā€™s changes. Then merge feature back into develop, using a --no-ff merge, to retain the merge commit.
  14. Rebase then squash ā€“ First rebase the feature branch onto current develop to pick up branch Bā€™s changes. Then interactive rebase to squash to one or a few large commits. Then fast-forward merge feature into develop.
  15. ??????
  16. SO MUCH STUFF TO READ, you guys. Seriously.