SlideShare a Scribd company logo
1 of 27
Git up to speed
with David Alpert
Learning goals
• Don’t fear the git
• Understand basic principles:
– How git stores changes
– What that means for you
• Don’t fear the git
Don’t fear the git
Not your parents’
source control
Forget
• Check out (i.e. unlock)
• Files are locked by default
• Must be connected
in real-time
• Merges are scary
• Don’t merge unrelated branch
• Branching is expensive
Embrace
• It’s already yours
• Work first, commit later
• You have your own copy
(of everything)
• Merges are hard work
(but not so much as before)
• Merge is a merge is a …
• Branching is cheap & fast
Not your parents’
source control
Forget
• Revision numbers
• The central authority
• Latest version
• IDE integration
Embrace
• Hashes
• Everyone has a copy
• View the log
• Command Line
Common fears
Git is unmanageable – there’s no central authority!
• Every clone is a full copy; this means many backups and extra redundancy.
• It is common to declare one central copy of the repo as the “authority” (or “origin”)
and use a workflow that enforces that.
“Git history is a bunch of lies”
• Rewriting local history is one of the great benefits of git
Git is too complicated
• Learn the basics & try it out
The command line is unfriendly
• Command line is very helpful, once you know the basics.
“Git will eat all of your code and you’ll never ever be able to get it back!”
• You can recover almost any commit, even ones that you’ve orphaned.
• The “reflog” will save your bacon!
bitly.com/11Px78L | bit.ly/15w82WF
Basic Concepts
What is:
a Directed Acyclic Graph?
http://light.physics.auth.gr/graphs/gr_history_en.html
Mathspeak What it means
A graph A collection of dots and lines
(called vertices and edges)
What is:
a Directed Acyclic Graph?
http://stackoverflow.com/questions/4625440/cycle-enumeration-of-a-directed-graph-with-multi-edges
Mathspeak What it means
A graph A collection of dots and lines
(called vertices and edges)
A directed
graph
The edges have arrows
indicating which direction
the line points.
What is:
a Directed Acyclic Graph?
http://en.wikipedia.org/wiki/File:Directed_acyclic_graph_3.svg
Mathspeak What it means
A graph A collection of dots and lines
(called vertices and edges)
A directed
graph
The edges have arrows
indicating which direction
the line points.
A directed
acyclic graph
The arrows make
no closed loops
(i.e. no cycles)
Why is this important?
http://nvie.com/posts/a-successful-git-branching-model/
Mathspeak What it means
A graph A collection of dots and lines
(called vertices and edges)
A directed
graph
The edges have arrows
indicating which direction
the line points.
A directed
acyclic graph
The arrows make
no closed loops
(i.e. no cycles)
How git stores changes
The object store
Commit
Tree
Blob
What is the index?
Working directory
The index
The object store
http://bit.ly/18QF4gx
What is the index?
Working directory
The index
The object store
http://bit.ly/18QF4gx
Time
What is the index?
Working directory
The index
The object store
http://bit.ly/18QF4gx
Time
Blob
What is the index?
Working directory
The index
The object store
http://bit.ly/18QF4gx
Time
Commit
Tree
Blob
What is the index?
Working directory
The index
The object store
http://bit.ly/18QF4gx
Time
Commit
Tree
Blob
What is the index?
Working directory
The index
The object store
http://bit.ly/18QF4gx
Time
Commit
Tree
Blob
gitk
--all
&
Your git toolkit (free)
git bash (shell)
gitk --all &
Show me teh codz
http://www.gurl.com/2012/03/10/cats-sleeping-in-weird-places/
Syntax Comparison
Phase Subversion
Team Foundation
Source Control (TFSC) Git
Initial Checkout Get Latest Clone
Daily Update Get Latest Fetch or Pull
Checkout (unlock)
-- do work -- -- do work -- -- do work --
Review Status View Pending Changes Status
Stage changes Add Add
Save your work Check in (remote) Check in (remote) Commit (local)
Share your work -- done -- -- done -- Push (to remote)
Common commands
Command
git branch Create a (local) branch
git checkout {target} Update working copy to a specific commit
git status View status of working copy & index
git add [{filepath}] Stage files from working copy -> index
git commit Commit indexed changes into local repo
git rebase {target} {source} Rewrite local history
git merge {target} Merge this branch into another branch
git fetch {remoteName} Bring remote changes into local repo
git pull {remote} Fetch, then merge
git push {remote} {localBranchName} Share your local commits with others
gitk --all & Open the gitk tool in the background
What is rebasing?
http://bit.ly/16dstHr
What is the reflog?
Online tutorials
Title URL
Code School – Try Git http://bit.ly/11eaP5C
Learn Git Branching http://bit.ly/18R1L45
A successful git branching model https://bitly.com/qcZc8E
Set up git http://bit.ly/10lwGlc
Git cheat sheet http://bit.ly/YBUXIn
Learning goals
• Don’t fear the git
• Understand basic principles:
– How git stores changes
– What that means for you
• Don’t fear the git
Next steps
• Google: “git tutorial” or visit bit.ly/gituptospeed
• Try it out
David Alpert |@davidalpert

More Related Content

What's hot

Experiences in ELK with D3.js for Large Log Analysis and Visualization
Experiences in ELK with D3.js  for Large Log Analysis  and VisualizationExperiences in ELK with D3.js  for Large Log Analysis  and Visualization
Experiences in ELK with D3.js for Large Log Analysis and VisualizationSurasak Sanguanpong
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...ForgeRock
 
libAttachSQL, The Next-Generation C Connector For MySQL
libAttachSQL, The Next-Generation C Connector For MySQLlibAttachSQL, The Next-Generation C Connector For MySQL
libAttachSQL, The Next-Generation C Connector For MySQLAndrew Hutchings
 
ELK Elasticsearch Logstash and Kibana Stack for Log Management
ELK Elasticsearch Logstash and Kibana Stack for Log ManagementELK Elasticsearch Logstash and Kibana Stack for Log Management
ELK Elasticsearch Logstash and Kibana Stack for Log ManagementEl Mahdi Benzekri
 
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech MeetupLogstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech MeetupStartit
 
Spark Workflow Management
Spark Workflow ManagementSpark Workflow Management
Spark Workflow ManagementRomi Kuntsman
 
Log analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and KibanaLog analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and KibanaAvinash Ramineni
 
Monitoring with Graylog - a modern approach to monitoring?
Monitoring with Graylog - a modern approach to monitoring?Monitoring with Graylog - a modern approach to monitoring?
Monitoring with Graylog - a modern approach to monitoring?inovex GmbH
 
ログ収集プラットフォーム開発におけるElasticsearchの運用
ログ収集プラットフォーム開発におけるElasticsearchの運用ログ収集プラットフォーム開発におけるElasticsearchの運用
ログ収集プラットフォーム開発におけるElasticsearchの運用LINE Corporation
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logsSmartLogic
 
Node collaboration - sharing information between your systems
Node collaboration - sharing information between your systemsNode collaboration - sharing information between your systems
Node collaboration - sharing information between your systemsm_richardson
 
Workflow Engines for Hadoop
Workflow Engines for HadoopWorkflow Engines for Hadoop
Workflow Engines for HadoopJoe Crobak
 
Hooking up Semantic MediaWiki with external tools via SPARQL
Hooking up Semantic MediaWiki with external tools via SPARQLHooking up Semantic MediaWiki with external tools via SPARQL
Hooking up Semantic MediaWiki with external tools via SPARQLSamuel Lampa
 
A Call for Sanity in NoSQL
A Call for Sanity in NoSQLA Call for Sanity in NoSQL
A Call for Sanity in NoSQLC4Media
 
DEF CON 23 - Topher Timzen and Ryan Allen - hijacking arbitrary NET APP Contr...
DEF CON 23 - Topher Timzen and Ryan Allen - hijacking arbitrary NET APP Contr...DEF CON 23 - Topher Timzen and Ryan Allen - hijacking arbitrary NET APP Contr...
DEF CON 23 - Topher Timzen and Ryan Allen - hijacking arbitrary NET APP Contr...Felipe Prado
 
B4usolution git git-hub
B4usolution git git-hubB4usolution git git-hub
B4usolution git git-hubb4usolution .
 
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.comRenzo Tomà
 

What's hot (20)

Experiences in ELK with D3.js for Large Log Analysis and Visualization
Experiences in ELK with D3.js  for Large Log Analysis  and VisualizationExperiences in ELK with D3.js  for Large Log Analysis  and Visualization
Experiences in ELK with D3.js for Large Log Analysis and Visualization
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
 
libAttachSQL, The Next-Generation C Connector For MySQL
libAttachSQL, The Next-Generation C Connector For MySQLlibAttachSQL, The Next-Generation C Connector For MySQL
libAttachSQL, The Next-Generation C Connector For MySQL
 
Elk scilifelab
Elk scilifelabElk scilifelab
Elk scilifelab
 
ELK Elasticsearch Logstash and Kibana Stack for Log Management
ELK Elasticsearch Logstash and Kibana Stack for Log ManagementELK Elasticsearch Logstash and Kibana Stack for Log Management
ELK Elasticsearch Logstash and Kibana Stack for Log Management
 
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech MeetupLogstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
 
Spark Workflow Management
Spark Workflow ManagementSpark Workflow Management
Spark Workflow Management
 
Log analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and KibanaLog analysis using Logstash,ElasticSearch and Kibana
Log analysis using Logstash,ElasticSearch and Kibana
 
Monitoring with Graylog - a modern approach to monitoring?
Monitoring with Graylog - a modern approach to monitoring?Monitoring with Graylog - a modern approach to monitoring?
Monitoring with Graylog - a modern approach to monitoring?
 
ログ収集プラットフォーム開発におけるElasticsearchの運用
ログ収集プラットフォーム開発におけるElasticsearchの運用ログ収集プラットフォーム開発におけるElasticsearchの運用
ログ収集プラットフォーム開発におけるElasticsearchの運用
 
Logstash: Get to know your logs
Logstash: Get to know your logsLogstash: Get to know your logs
Logstash: Get to know your logs
 
Node collaboration - sharing information between your systems
Node collaboration - sharing information between your systemsNode collaboration - sharing information between your systems
Node collaboration - sharing information between your systems
 
Workflow Engines for Hadoop
Workflow Engines for HadoopWorkflow Engines for Hadoop
Workflow Engines for Hadoop
 
Introduction to ELK
Introduction to ELKIntroduction to ELK
Introduction to ELK
 
Log
LogLog
Log
 
Hooking up Semantic MediaWiki with external tools via SPARQL
Hooking up Semantic MediaWiki with external tools via SPARQLHooking up Semantic MediaWiki with external tools via SPARQL
Hooking up Semantic MediaWiki with external tools via SPARQL
 
A Call for Sanity in NoSQL
A Call for Sanity in NoSQLA Call for Sanity in NoSQL
A Call for Sanity in NoSQL
 
DEF CON 23 - Topher Timzen and Ryan Allen - hijacking arbitrary NET APP Contr...
DEF CON 23 - Topher Timzen and Ryan Allen - hijacking arbitrary NET APP Contr...DEF CON 23 - Topher Timzen and Ryan Allen - hijacking arbitrary NET APP Contr...
DEF CON 23 - Topher Timzen and Ryan Allen - hijacking arbitrary NET APP Contr...
 
B4usolution git git-hub
B4usolution git git-hubB4usolution git git-hub
B4usolution git git-hub
 
Scaling an ELK stack at bol.com
Scaling an ELK stack at bol.comScaling an ELK stack at bol.com
Scaling an ELK stack at bol.com
 

Similar to Git uptospeed

Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIsTim Osborn
 
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)Ahmed El-Arabawy
 
Learn Git form Beginners to Master
Learn Git form Beginners to MasterLearn Git form Beginners to Master
Learn Git form Beginners to MasterC. M. Abdullah Khan
 
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
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't CodeChristopher Schmitt
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitRobert Lee-Cann
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Ahmed El-Arabawy
 

Similar to Git uptospeed (20)

Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git_new.pptx
Git_new.pptxGit_new.pptx
Git_new.pptx
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Introduction to Git and GitHub
Introduction to Git and GitHubIntroduction to Git and GitHub
Introduction to Git and GitHub
 
Demo
DemoDemo
Demo
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Git for folk who like GUIs
Git for folk who like GUIsGit for folk who like GUIs
Git for folk who like GUIs
 
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
 
Gitlikeapro 2019
Gitlikeapro 2019Gitlikeapro 2019
Gitlikeapro 2019
 
Learn Git form Beginners to Master
Learn Git form Beginners to MasterLearn Git form Beginners to Master
Learn Git form Beginners to Master
 
Git hub
Git hubGit hub
Git hub
 
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
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 
[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code[artifactconf] Github for People Who Don't Code
[artifactconf] Github for People Who Don't Code
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Git and Github
Git and GithubGit and Github
Git and Github
 
Git
GitGit
Git
 

Git uptospeed

  • 1. Git up to speed with David Alpert
  • 2. Learning goals • Don’t fear the git • Understand basic principles: – How git stores changes – What that means for you • Don’t fear the git
  • 4. Not your parents’ source control Forget • Check out (i.e. unlock) • Files are locked by default • Must be connected in real-time • Merges are scary • Don’t merge unrelated branch • Branching is expensive Embrace • It’s already yours • Work first, commit later • You have your own copy (of everything) • Merges are hard work (but not so much as before) • Merge is a merge is a … • Branching is cheap & fast
  • 5. Not your parents’ source control Forget • Revision numbers • The central authority • Latest version • IDE integration Embrace • Hashes • Everyone has a copy • View the log • Command Line
  • 6. Common fears Git is unmanageable – there’s no central authority! • Every clone is a full copy; this means many backups and extra redundancy. • It is common to declare one central copy of the repo as the “authority” (or “origin”) and use a workflow that enforces that. “Git history is a bunch of lies” • Rewriting local history is one of the great benefits of git Git is too complicated • Learn the basics & try it out The command line is unfriendly • Command line is very helpful, once you know the basics. “Git will eat all of your code and you’ll never ever be able to get it back!” • You can recover almost any commit, even ones that you’ve orphaned. • The “reflog” will save your bacon! bitly.com/11Px78L | bit.ly/15w82WF
  • 8. What is: a Directed Acyclic Graph? http://light.physics.auth.gr/graphs/gr_history_en.html Mathspeak What it means A graph A collection of dots and lines (called vertices and edges)
  • 9. What is: a Directed Acyclic Graph? http://stackoverflow.com/questions/4625440/cycle-enumeration-of-a-directed-graph-with-multi-edges Mathspeak What it means A graph A collection of dots and lines (called vertices and edges) A directed graph The edges have arrows indicating which direction the line points.
  • 10. What is: a Directed Acyclic Graph? http://en.wikipedia.org/wiki/File:Directed_acyclic_graph_3.svg Mathspeak What it means A graph A collection of dots and lines (called vertices and edges) A directed graph The edges have arrows indicating which direction the line points. A directed acyclic graph The arrows make no closed loops (i.e. no cycles)
  • 11. Why is this important? http://nvie.com/posts/a-successful-git-branching-model/ Mathspeak What it means A graph A collection of dots and lines (called vertices and edges) A directed graph The edges have arrows indicating which direction the line points. A directed acyclic graph The arrows make no closed loops (i.e. no cycles)
  • 12. How git stores changes The object store Commit Tree Blob
  • 13. What is the index? Working directory The index The object store http://bit.ly/18QF4gx
  • 14. What is the index? Working directory The index The object store http://bit.ly/18QF4gx Time
  • 15. What is the index? Working directory The index The object store http://bit.ly/18QF4gx Time Blob
  • 16. What is the index? Working directory The index The object store http://bit.ly/18QF4gx Time Commit Tree Blob
  • 17. What is the index? Working directory The index The object store http://bit.ly/18QF4gx Time Commit Tree Blob
  • 18. What is the index? Working directory The index The object store http://bit.ly/18QF4gx Time Commit Tree Blob
  • 20. Your git toolkit (free) git bash (shell) gitk --all &
  • 21. Show me teh codz http://www.gurl.com/2012/03/10/cats-sleeping-in-weird-places/
  • 22. Syntax Comparison Phase Subversion Team Foundation Source Control (TFSC) Git Initial Checkout Get Latest Clone Daily Update Get Latest Fetch or Pull Checkout (unlock) -- do work -- -- do work -- -- do work -- Review Status View Pending Changes Status Stage changes Add Add Save your work Check in (remote) Check in (remote) Commit (local) Share your work -- done -- -- done -- Push (to remote)
  • 23. Common commands Command git branch Create a (local) branch git checkout {target} Update working copy to a specific commit git status View status of working copy & index git add [{filepath}] Stage files from working copy -> index git commit Commit indexed changes into local repo git rebase {target} {source} Rewrite local history git merge {target} Merge this branch into another branch git fetch {remoteName} Bring remote changes into local repo git pull {remote} Fetch, then merge git push {remote} {localBranchName} Share your local commits with others gitk --all & Open the gitk tool in the background
  • 25. What is the reflog?
  • 26. Online tutorials Title URL Code School – Try Git http://bit.ly/11eaP5C Learn Git Branching http://bit.ly/18R1L45 A successful git branching model https://bitly.com/qcZc8E Set up git http://bit.ly/10lwGlc Git cheat sheet http://bit.ly/YBUXIn
  • 27. Learning goals • Don’t fear the git • Understand basic principles: – How git stores changes – What that means for you • Don’t fear the git Next steps • Google: “git tutorial” or visit bit.ly/gituptospeed • Try it out David Alpert |@davidalpert

Editor's Notes

  1. Open your mind to a new way of tracking your changes.
  2. Open your mind to a new way of tracking your changes.
  3. Stores SNAPSHOTSPresents DIFFS