SlideShare a Scribd company logo
git
you won't learn git
in twenty minutes at a LUG
but here are twenty-odd slides anyway
sorry there are no pictures
David Spencer
Bradford Linux Users Group
14 September 2015
quick quiz
Who uses it?
or has tried it?
or wants to try it, started reading about it, and got put off?
What do we know about it?
● purpose
● history
● other similar tools
(has anybody here used other tools?)
what
source code control system
revolutionised a stale technology
popular, or even trendy
(this was not foreseeable)
Github is the new Sourceforge...
Github is the new Linkedin?
Github is the new Blogger?
Github is the new git?
who and why and when
January 2002: Linus doesn't scale
Bitkeeper trial
the only suitable software, but proprietary
Early 2005: terminated amicably but suddenly
Tridge reverse engineered the Bitkeeper protocol
2.6.12-rc2 left high and dry
Linus coding binge
I'm an egotistical bastard, and I
name all my projects after myself.
First 'Linux', now 'Git'
3 April 2005 - started
6 April - announced
7 April - self hosting
11 April - "I don't even know yet.
I'm playing around with my own scripts and tools right now"
18 April - first big Linux merge
29 April - merging Linux at 6.7 patches/sec
16 June - 2.6.12 released
26 July - Linus hands over to Junio Hamano
21 December - git-1.0
design
Fast
Distributed data store, and distributed workflow
Scales well
CVS as an example of what not to do
(if in doubt, do the opposite)
Really just a name/value data store
(colossal understatement)
Strong safeguards against corruption
what's it useful for?
why should we care?
Answering the second question first:
because lots of other people find it useful
Answering the first question second:
working with other people
(and maybe keeping your own stuff tidy)
Use The Source
Command line
git clone http://github.com/darktable-org/darktable.git
network aware
receive a subdirectory 'darktable'
contains
(a) the source tree (as if you'd extracted a tarball)
(b) hidden directory .git/ with ALL the metadata
bang up to date
just follow the instructions like a tarball
Contribute back
Your 'git clone' is a first class copy
You can modify it and offer the changes back
("pull request", or send email patches)
You can push the changes back if authorised
git push
You can distribute independently (fork)
You can receive and merge changes
(from "upstream" ... from anywhere)
git fetch, git merge, git pull
How it works
Initialise a new directory
or existing directory tree or clone
.git contains a key-value store
Keys are SHA-1 40 character hex hashes
Values are file deltas
(1) highly efficient to store and restore
(2) cryptographically secure
That doesn't sound like CVS or Visual Studio!
... until you realise ...
(3) file deltas == file history
How it works
Source management commands ("porcelain")
are implemented as key/value store operations ("plumbing")
edit edit edit edit
Looks good?
git add <filenames>
hm, maybe a bit more editing
git add <filenames>
don't need that any more
git rm <filename>
Yes that's good
git commit -m 'Description of my changes'
commits
identified by 40 character hex string
(old systems just used increasing revision number)
but can be truncated to just first few (7-ish)
aliases:
HEAD, tag (release), branchname
(just identify a key in the key-value store)
you can go back to a commit, diff with a commit,
read the message, cherry-pick, format a patch...
branches
Ever had some script that worked well
but you wanted to make some improvements
stuffed it up
wished you could go back?
or even have two versions
one stable
the other experimental?
This is what branches are for
branches
Ever had multiple people working on different
aspects of the same project?
Falling over each other's incompatible changes?
This also is what branches are for
Merging them is tricky
git has lots of handy solutions for that
git diff, three way diff tools (meld)
git merge, git rebase
history
Who made these changes and when?
git log
git blame
It used to work, what change introduced this bug?
git bisect
history
cryptographically secure
=> history cannot be falsified
=> can be rewritten (quick quiz)
=> anyone with old history will experience pain
(quick quiz)
Once you publish your commits
don't rewrite history
not ever ... srsly
git commit --amend
Github
Uses:
Sourceforge without the smell of death
and client-side too
Abuses?
blogs, articles
Controversies
China, DMCA
Alternatives
Atlassian Bitbucket https://bitbucket.org/
weird uses
etckeeper
saving games
more?
crappiness
git extensions (mostly crap)
git graphical interfaces (mostly crap)
Not crap: github, cgit
merge conflicts in the middle of a rebase
JUST FORGET THAT CRAP DAMN YOU <RAGEFACE>
crappy people who don't do releases
Learn how to use git tag, srsly
projects still using other crap
svn mercurial bzr ...
people who tell people they are doing git wrong
gitflow == follow my crap rules, you'll feel secure and I'll feel important
learning
Vast amount of tutorials, mostly crap
Annoying diagrams of commits and branches
Annoying terminology (index, staging)
Command line inconsistencies
Git manpages ok-ish
Github help is crap
Learn by doing (doesn't work for scary stuff)
https://try.github.io/levels/1/challenges/1
learning
Worked tutorials
https://try.github.io/
http://rogerdudler.github.io/git-guide/
Pro Git (book)
https://git-scm.com/book/en/v2
Git from the bottom up
http://ftp.newartisans.com/pub/git.from.bottom.up.pdf
Manpages
https://git-scm.com/docs and man git-thing
https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf
So you have a mess on your hands
http://justinhileman.info/article/git-pretty/git-pretty.pdf
learning
Linus on YouTube (2007, long)
https://www.youtube.com/watch?v=4XpnKHJAok8
Linus on YouTube (2009, even longer)
https://www.youtube.com/watch?v=8ET_gl1qAZ0
Adolf on YouTube (1945, very short)
https://www.youtube.com/watch?v=CDeG4S-mJts
some new words we learned today
repository
commit, history
branch, fork, clone, tag
HEAD
master
index, working tree
fetch, merge, pull, push
patch
questions?
experiences?
Git slides

More Related Content

PPTX
Workshop on Source control, git merge walkthroughs
PDF
Introducing Git and git flow
PPTX
Git & git hub
PDF
PDF
Git tutorial for CS320 Students
PDF
Git
PPTX
PDF
Enjoy fighting regressions_with_git_bisect
Workshop on Source control, git merge walkthroughs
Introducing Git and git flow
Git & git hub
Git tutorial for CS320 Students
Git
Enjoy fighting regressions_with_git_bisect

What's hot (20)

PDF
Git and GitHub
PDF
Git push to build, test and scan your containers
PDF
Intro to Git
PPTX
Git and eclipse
PDF
Getting started With GIT
PPTX
PDF
Git workshop
PDF
What makes Python So Awesome
ODP
Besut Kode - Workshop 1
PDF
Introduction to Git for Non-Developers
PPTX
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
KEY
An introduction to Git.
PPTX
Introduction to GIT versioning
PPTX
Web Programming - Git basics
ODP
Bang a Gong, GIT It On, or Running Drupal With a GIT Repository (11/04/20 - B...
PDF
SCMBC闇LT資料
ODP
Besut Kode Challenge 1
PDF
Contributing to open source using Git
PDF
SCM Boot Camp
Git and GitHub
Git push to build, test and scan your containers
Intro to Git
Git and eclipse
Getting started With GIT
Git workshop
What makes Python So Awesome
Besut Kode - Workshop 1
Introduction to Git for Non-Developers
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
An introduction to Git.
Introduction to GIT versioning
Web Programming - Git basics
Bang a Gong, GIT It On, or Running Drupal With a GIT Repository (11/04/20 - B...
SCMBC闇LT資料
Besut Kode Challenge 1
Contributing to open source using Git
SCM Boot Camp
Ad

Similar to Git slides (20)

PPTX
Introduction to git hub
PDF
Introduction to Git
PPT
Introduction to git
PPTX
Introduction to GitHub, Open Source and Tech Article
PDF
Harvard ABCD-WWW Git presentation
PPTX
Version controll.pptx
PDF
Git: a brief introduction
PPTX
1-Intro to VC & GIT PDF.pptx
PDF
GDSC ZHCET GitHub Session.pdf
PPTX
Mini-training: Let’s Git It!
PPTX
git github PPT_GDSCIIITK.pptx
PDF
Git for developers
PPT
Fundamentals and basics of Git and commands
KEY
Let's Git this Party Started: An Introduction to Git and GitHub
PDF
Version Control System - Git
PDF
Introduction to Git, DrupalCamp LA 2015
PDF
Why Git Sucks and you'll use it anyways
PPTX
Git 101 for Beginners
PPTX
Git workshop 33degree 2011 krakow
PPT
Git training
Introduction to git hub
Introduction to Git
Introduction to git
Introduction to GitHub, Open Source and Tech Article
Harvard ABCD-WWW Git presentation
Version controll.pptx
Git: a brief introduction
1-Intro to VC & GIT PDF.pptx
GDSC ZHCET GitHub Session.pdf
Mini-training: Let’s Git It!
git github PPT_GDSCIIITK.pptx
Git for developers
Fundamentals and basics of Git and commands
Let's Git this Party Started: An Introduction to Git and GitHub
Version Control System - Git
Introduction to Git, DrupalCamp LA 2015
Why Git Sucks and you'll use it anyways
Git 101 for Beginners
Git workshop 33degree 2011 krakow
Git training
Ad

Recently uploaded (20)

PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Transform Your Business with a Software ERP System
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
System and Network Administraation Chapter 3
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Nekopoi APK 2025 free lastest update
PPTX
L1 - Introduction to python Backend.pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
medical staffing services at VALiNTRY
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
System and Network Administration Chapter 2
PPTX
Introduction to Artificial Intelligence
PPTX
Odoo POS Development Services by CandidRoot Solutions
Upgrade and Innovation Strategies for SAP ERP Customers
Navsoft: AI-Powered Business Solutions & Custom Software Development
Transform Your Business with a Software ERP System
Softaken Excel to vCard Converter Software.pdf
PTS Company Brochure 2025 (1).pdf.......
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
System and Network Administraation Chapter 3
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
How to Choose the Right IT Partner for Your Business in Malaysia
Nekopoi APK 2025 free lastest update
L1 - Introduction to python Backend.pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Wondershare Filmora 15 Crack With Activation Key [2025
medical staffing services at VALiNTRY
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
VVF-Customer-Presentation2025-Ver1.9.pptx
System and Network Administration Chapter 2
Introduction to Artificial Intelligence
Odoo POS Development Services by CandidRoot Solutions

Git slides

  • 1. git you won't learn git in twenty minutes at a LUG but here are twenty-odd slides anyway sorry there are no pictures David Spencer Bradford Linux Users Group 14 September 2015
  • 2. quick quiz Who uses it? or has tried it? or wants to try it, started reading about it, and got put off? What do we know about it? ● purpose ● history ● other similar tools (has anybody here used other tools?)
  • 3. what source code control system revolutionised a stale technology popular, or even trendy (this was not foreseeable) Github is the new Sourceforge... Github is the new Linkedin? Github is the new Blogger? Github is the new git?
  • 4. who and why and when January 2002: Linus doesn't scale Bitkeeper trial the only suitable software, but proprietary Early 2005: terminated amicably but suddenly Tridge reverse engineered the Bitkeeper protocol 2.6.12-rc2 left high and dry Linus coding binge
  • 5. I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'Git' 3 April 2005 - started 6 April - announced 7 April - self hosting 11 April - "I don't even know yet. I'm playing around with my own scripts and tools right now" 18 April - first big Linux merge 29 April - merging Linux at 6.7 patches/sec 16 June - 2.6.12 released 26 July - Linus hands over to Junio Hamano 21 December - git-1.0
  • 6. design Fast Distributed data store, and distributed workflow Scales well CVS as an example of what not to do (if in doubt, do the opposite) Really just a name/value data store (colossal understatement) Strong safeguards against corruption
  • 7. what's it useful for? why should we care? Answering the second question first: because lots of other people find it useful Answering the first question second: working with other people (and maybe keeping your own stuff tidy)
  • 8. Use The Source Command line git clone http://github.com/darktable-org/darktable.git network aware receive a subdirectory 'darktable' contains (a) the source tree (as if you'd extracted a tarball) (b) hidden directory .git/ with ALL the metadata bang up to date just follow the instructions like a tarball
  • 9. Contribute back Your 'git clone' is a first class copy You can modify it and offer the changes back ("pull request", or send email patches) You can push the changes back if authorised git push You can distribute independently (fork) You can receive and merge changes (from "upstream" ... from anywhere) git fetch, git merge, git pull
  • 10. How it works Initialise a new directory or existing directory tree or clone .git contains a key-value store Keys are SHA-1 40 character hex hashes Values are file deltas (1) highly efficient to store and restore (2) cryptographically secure That doesn't sound like CVS or Visual Studio! ... until you realise ... (3) file deltas == file history
  • 11. How it works Source management commands ("porcelain") are implemented as key/value store operations ("plumbing") edit edit edit edit Looks good? git add <filenames> hm, maybe a bit more editing git add <filenames> don't need that any more git rm <filename> Yes that's good git commit -m 'Description of my changes'
  • 12. commits identified by 40 character hex string (old systems just used increasing revision number) but can be truncated to just first few (7-ish) aliases: HEAD, tag (release), branchname (just identify a key in the key-value store) you can go back to a commit, diff with a commit, read the message, cherry-pick, format a patch...
  • 13. branches Ever had some script that worked well but you wanted to make some improvements stuffed it up wished you could go back? or even have two versions one stable the other experimental? This is what branches are for
  • 14. branches Ever had multiple people working on different aspects of the same project? Falling over each other's incompatible changes? This also is what branches are for Merging them is tricky git has lots of handy solutions for that git diff, three way diff tools (meld) git merge, git rebase
  • 15. history Who made these changes and when? git log git blame It used to work, what change introduced this bug? git bisect
  • 16. history cryptographically secure => history cannot be falsified => can be rewritten (quick quiz) => anyone with old history will experience pain (quick quiz) Once you publish your commits don't rewrite history not ever ... srsly git commit --amend
  • 17. Github Uses: Sourceforge without the smell of death and client-side too Abuses? blogs, articles Controversies China, DMCA Alternatives Atlassian Bitbucket https://bitbucket.org/
  • 19. crappiness git extensions (mostly crap) git graphical interfaces (mostly crap) Not crap: github, cgit merge conflicts in the middle of a rebase JUST FORGET THAT CRAP DAMN YOU <RAGEFACE> crappy people who don't do releases Learn how to use git tag, srsly projects still using other crap svn mercurial bzr ... people who tell people they are doing git wrong gitflow == follow my crap rules, you'll feel secure and I'll feel important
  • 20. learning Vast amount of tutorials, mostly crap Annoying diagrams of commits and branches Annoying terminology (index, staging) Command line inconsistencies Git manpages ok-ish Github help is crap Learn by doing (doesn't work for scary stuff) https://try.github.io/levels/1/challenges/1
  • 21. learning Worked tutorials https://try.github.io/ http://rogerdudler.github.io/git-guide/ Pro Git (book) https://git-scm.com/book/en/v2 Git from the bottom up http://ftp.newartisans.com/pub/git.from.bottom.up.pdf Manpages https://git-scm.com/docs and man git-thing https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf So you have a mess on your hands http://justinhileman.info/article/git-pretty/git-pretty.pdf
  • 22. learning Linus on YouTube (2007, long) https://www.youtube.com/watch?v=4XpnKHJAok8 Linus on YouTube (2009, even longer) https://www.youtube.com/watch?v=8ET_gl1qAZ0 Adolf on YouTube (1945, very short) https://www.youtube.com/watch?v=CDeG4S-mJts
  • 23. some new words we learned today repository commit, history branch, fork, clone, tag HEAD master index, working tree fetch, merge, pull, push patch