SlideShare a Scribd company logo
Nicolás Tourné @nicotourne
CTO of BeeReal
Tandil, Argentina - 2013
#BeeTalks
Starting with
Git & GitHub
Agenda
• What’s a Version Control System?
• What the heck is Git?
• Some Git commands
• What’s about GitHub?
• Git in Action!
What’s a Version Control System?
“An application that allows you to
record changes to your codebase in a
structured and controlled fashion.”
Why do I need that?
• Makes it way easier to undo errors / roll
back to earlier versions of code
• Makes it way easier to share a codebase
between developers without creating
conflicts
• Makes it way easier to deploy changes
from development to staging or production
environments
Popular Version Control Systems
• CVS - Concurrent Version System
• SVN - SubVersioN
• Git
• Mercurial
• Bazaar
• LibreSource
What the heck is Git?
• Distributed Source Control system
• Open source, free (GNU GPL V2)
• Originally developed by Linus Torvalds for
the development of the Linux Kernel in 2005
• Focus on speed and efficiency
• Quite a unique design and therefore
sometimes a bit scary and difficult to
understand
• Save snapshots, no differences
• Branching (lightweight & fast)
• Automatic merge of files
• Used on personal or very large projects, and
for all size of teams
What the heck is Git?
Distributed Development
• Every Git working directory contains the
complete repository and history and full
revision tracking capabilities
• You’re not dependent on a central server
and you don’t have to be online
• It’s extremely fast - much faster than SVN,
CVS and other systems
Centralized vs Distributed
Development
SVN / CVS - Centralized development
John
Central
Peter Bob Carl
Git - Distributed development
Centralized vs Distributed
Development
John
Peter
Bob
Carl
Central
A Git Sample
1. A new git is initialized as a remote
repository
John Remote repository Peter
master
C0
A Git Sample
2. John and Peter clone the git repository
John Remote repository Peter
master
C0
master
C0
master
C0
A Git Sample
3. John does a commit
John Remote repository Peter
master
C1
master
C0
master
C0
C0
A Git Sample
4. John does a push
John Remote repository Peter
master
C1
master
C0
C0
master
C1
C0
A Git Sample
5. Peter does a pull
John Remote repository Peter
master
C1
master
C1
C0
master
C1
C0 C0
A Git Sample
6. John does a commit & push
John Remote repository Peter
master
C2
master
C1
C1
master
C2
C0 C0
C0 C0
A Git Sample
7. Peter does a commit
John Remote repository Peter
master
C2
master
C3
C1
master
C2
C1 C1
C0 C0 C0
A Git Sample
8. Peter does a pull (fetch & merge)
John Remote repository Peter
master
C2
master
C2C1
master
C2
C1
C1C0 C0
C0
C3
C4
A Git Sample
9. Peter does a push
John Remote repository Peter
master
C2
master
C2C1
master
C4
C1C0 C1
C0
C3
C4
C2 C3
C0
A Git Sample
10. John does a pull
John Remote repository Peter
master
C4
master
C2
master
C4
C1C1 C1
C0
C3
C4
C2 C3
C0
C2 C3
C0
Git Commands
Getting and Creating projects
init
To create a git repository from an existing
directory of files
$ git init
clone
If you want to get a copy of a project, you
need to clone it
$ git clone [url]
Git Commands
Basic Snapshotting
git add
You have to add file contents to your staging
area before you can commit them
$ git add index.php
git status
View the status of your files in the working
directory and staging area
$ git status
Git Commands
Basic Snapshotting
git diff
Shows diff of what is staged and what is
modified but unstaged
$ git diff
git commit
Records a snapshot of the staging area
$ git commit -m “My comment”
Git Commands
Basic Snapshotting
git reset
Undo changed and commits
$ git reset
git rm
Remove files from the staging area
$ git rm index.php
Git Commands
Basic Snapshotting
git mv
Git doesn’t track file renames
$ git mv index.php index.html
git stash
Save changes made in the current index and
working directory for later
$ git stash
Git Commands
Branching and Merging
git branch
List, create and manage branches
$ git branch
$ git branch QA
git checkout
Switch to a new branch context
$ git checkout QA
$ git checkout -b live
Git Commands
Branching and Merging
git merge
Merge a branch context into your current one
$ git branch
$ git merge QA
git log
Show commit history of a branch
$ git log
Git Commands
Branching and Merging
git tag
Tag a point in history as important
$ git tag -a v1.0
Git Commands
Sharing and Updating Projects
git fetch
Download new branches and data from
remote repository
$ git fetch
git pull
Fetch from a remote repo and try to merge
into the current branch
$ git pull
Git Commands
Sharing and Updating Projects
git push
Push your new branches and data to a remote
repository
$ git push
What's about GitHub?
• It’s a Git repository hosting service… but it
adds many of its own features
• While Git is a command line tool, GitHub
provides a web-based graphical interface
• It also provides access control and several
collaboration features, such as wikis and
basic task management tools
What's about GitHub?
• By default, all projects are public and free. In
you want a private project, then pay
• You can clone any public repository, follow
projects and developers, post comments, etc
• It’s becoming the Facebook’s for developers
Git in Action!
Go to your computer and start playing...
1. Create a new repository on GitHub
2. Clone this repository
3. Add new files
4. Commit and push them
5. Create a new branch and merge files
Thank you
for your attention!
Questions?
Just tweet me @nicotourne
or mail me at ntourne@beerealit.com
beerealit.com
More info at...
Official Git site
http://git-scm.com
Some slides
http://www.slideshare.net/jomikr/quick-introduction-to-git
http://www.slideshare.net/reallyordinary/intro-to-git-for-drupal-7
http://www.slideshare.net/anildigital/git-introduction
http://www.slideshare.net/chacon/getting-git
Git commands
http://gitref.org/basic
GitHub site
http://github.com

More Related Content

PDF
Inside GitHub
 
PDF
Starting with Git & GitHub
PDF
Introduction to GitHub
PPTX
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
PPTX
Git in 10 minutes
PPT
Git Introduction
PDF
Introduction to Git, DrupalCamp LA 2015
PPTX
Git 101
Inside GitHub
 
Starting with Git & GitHub
Introduction to GitHub
Git and GitHub | Concept about Git and GitHub Process | Git Process overview
Git in 10 minutes
Git Introduction
Introduction to Git, DrupalCamp LA 2015
Git 101

What's hot (20)

PPTX
HacktoberFest-Git&GitHub
PPTX
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
PPTX
Workshop on Git and GitHub
PDF
Introduction to Git
PDF
Introduction to Git
PDF
Git, GitHub and Open Source
KEY
Let's Git this Party Started: An Introduction to Git and GitHub
PDF
git and github
PPTX
Git n git hub
PPTX
Introduction to github slideshare
PDF
Git and GitHub
PDF
How Git and Gerrit make you more productive
KEY
The everyday developer's guide to version control with Git
PDF
Brief tutorial on Git
PDF
Github Case Study By Amil Ali
PPTX
Git and Github Session
PDF
Git Version Control System
PPTX
Introduction to git and github
PPTX
GitHub Basics - Derek Bable
HacktoberFest-Git&GitHub
Git Tutorial For Beginners | What is Git and GitHub? | DevOps Tools | DevOps ...
Workshop on Git and GitHub
Introduction to Git
Introduction to Git
Git, GitHub and Open Source
Let's Git this Party Started: An Introduction to Git and GitHub
git and github
Git n git hub
Introduction to github slideshare
Git and GitHub
How Git and Gerrit make you more productive
The everyday developer's guide to version control with Git
Brief tutorial on Git
Github Case Study By Amil Ali
Git and Github Session
Git Version Control System
Introduction to git and github
GitHub Basics - Derek Bable
Ad

Viewers also liked (9)

DOC
CV-Pooja 3...
PDF
SHAMIQ1.RESUME new
PPTX
Can Marketers Get to Grips with the Human Condition?
PDF
Bilingual Evaluations: Writing the FIE report for Bilingual Students
PDF
Wyniki egzaminów PZS Lędziny
PPTX
Video Advertising Growth
PPTX
Baby Steps to Note-Taking for Consecutive Interpreting
DOCX
CV-Virendra
CV-Pooja 3...
SHAMIQ1.RESUME new
Can Marketers Get to Grips with the Human Condition?
Bilingual Evaluations: Writing the FIE report for Bilingual Students
Wyniki egzaminów PZS Lędziny
Video Advertising Growth
Baby Steps to Note-Taking for Consecutive Interpreting
CV-Virendra
Ad

Similar to Github (20)

PPTX
Lets Git Together
PPTX
01 - Git vs SVN
PPTX
Introduction to git hub
PDF
Git and Github - A primer
PPTX
git github PPT_GDSCIIITK.pptx
PDF
Git basics
PPTX
Version Control System-git status,git add,git commit,git log.pptx
PPTX
Git and GitHub (1).pptx
PPTX
Getting Git...before it gets you
PPTX
Introduction to GitHub, Open Source and Tech Article
PPTX
Mini-training: Let’s Git It!
PPTX
Git and github
PPTX
Git and Github
PPTX
Git and Github workshop GDSC MLRITM
PPTX
Version controll.pptx
PDF
Git Tutorial A Comprehensive Guide for Beginners.pdf
PDF
Git Pocket Guide A Working Introduction 1st Edition Richard E. Silverman
PPTX
GIT.pptx
PPTX
Getting Started with Git: A Primer for SVN and TFS Users
Lets Git Together
01 - Git vs SVN
Introduction to git hub
Git and Github - A primer
git github PPT_GDSCIIITK.pptx
Git basics
Version Control System-git status,git add,git commit,git log.pptx
Git and GitHub (1).pptx
Getting Git...before it gets you
Introduction to GitHub, Open Source and Tech Article
Mini-training: Let’s Git It!
Git and github
Git and Github
Git and Github workshop GDSC MLRITM
Version controll.pptx
Git Tutorial A Comprehensive Guide for Beginners.pdf
Git Pocket Guide A Working Introduction 1st Edition Richard E. Silverman
GIT.pptx
Getting Started with Git: A Primer for SVN and TFS Users

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Electronic commerce courselecture one. Pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Chapter 3 Spatial Domain Image Processing.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
Building Integrated photovoltaic BIPV_UPV.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Electronic commerce courselecture one. Pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx
MYSQL Presentation for SQL database connectivity
Bridging biosciences and deep learning for revolutionary discoveries: a compr...

Github

  • 1. Nicolás Tourné @nicotourne CTO of BeeReal Tandil, Argentina - 2013 #BeeTalks Starting with Git & GitHub
  • 2. Agenda • What’s a Version Control System? • What the heck is Git? • Some Git commands • What’s about GitHub? • Git in Action!
  • 3. What’s a Version Control System? “An application that allows you to record changes to your codebase in a structured and controlled fashion.”
  • 4. Why do I need that? • Makes it way easier to undo errors / roll back to earlier versions of code • Makes it way easier to share a codebase between developers without creating conflicts • Makes it way easier to deploy changes from development to staging or production environments
  • 5. Popular Version Control Systems • CVS - Concurrent Version System • SVN - SubVersioN • Git • Mercurial • Bazaar • LibreSource
  • 6. What the heck is Git? • Distributed Source Control system • Open source, free (GNU GPL V2) • Originally developed by Linus Torvalds for the development of the Linux Kernel in 2005 • Focus on speed and efficiency • Quite a unique design and therefore sometimes a bit scary and difficult to understand
  • 7. • Save snapshots, no differences • Branching (lightweight & fast) • Automatic merge of files • Used on personal or very large projects, and for all size of teams What the heck is Git?
  • 8. Distributed Development • Every Git working directory contains the complete repository and history and full revision tracking capabilities • You’re not dependent on a central server and you don’t have to be online • It’s extremely fast - much faster than SVN, CVS and other systems
  • 9. Centralized vs Distributed Development SVN / CVS - Centralized development John Central Peter Bob Carl
  • 10. Git - Distributed development Centralized vs Distributed Development John Peter Bob Carl Central
  • 11. A Git Sample 1. A new git is initialized as a remote repository John Remote repository Peter master C0
  • 12. A Git Sample 2. John and Peter clone the git repository John Remote repository Peter master C0 master C0 master C0
  • 13. A Git Sample 3. John does a commit John Remote repository Peter master C1 master C0 master C0 C0
  • 14. A Git Sample 4. John does a push John Remote repository Peter master C1 master C0 C0 master C1 C0
  • 15. A Git Sample 5. Peter does a pull John Remote repository Peter master C1 master C1 C0 master C1 C0 C0
  • 16. A Git Sample 6. John does a commit & push John Remote repository Peter master C2 master C1 C1 master C2 C0 C0 C0 C0
  • 17. A Git Sample 7. Peter does a commit John Remote repository Peter master C2 master C3 C1 master C2 C1 C1 C0 C0 C0
  • 18. A Git Sample 8. Peter does a pull (fetch & merge) John Remote repository Peter master C2 master C2C1 master C2 C1 C1C0 C0 C0 C3 C4
  • 19. A Git Sample 9. Peter does a push John Remote repository Peter master C2 master C2C1 master C4 C1C0 C1 C0 C3 C4 C2 C3 C0
  • 20. A Git Sample 10. John does a pull John Remote repository Peter master C4 master C2 master C4 C1C1 C1 C0 C3 C4 C2 C3 C0 C2 C3 C0
  • 21. Git Commands Getting and Creating projects init To create a git repository from an existing directory of files $ git init clone If you want to get a copy of a project, you need to clone it $ git clone [url]
  • 22. Git Commands Basic Snapshotting git add You have to add file contents to your staging area before you can commit them $ git add index.php git status View the status of your files in the working directory and staging area $ git status
  • 23. Git Commands Basic Snapshotting git diff Shows diff of what is staged and what is modified but unstaged $ git diff git commit Records a snapshot of the staging area $ git commit -m “My comment”
  • 24. Git Commands Basic Snapshotting git reset Undo changed and commits $ git reset git rm Remove files from the staging area $ git rm index.php
  • 25. Git Commands Basic Snapshotting git mv Git doesn’t track file renames $ git mv index.php index.html git stash Save changes made in the current index and working directory for later $ git stash
  • 26. Git Commands Branching and Merging git branch List, create and manage branches $ git branch $ git branch QA git checkout Switch to a new branch context $ git checkout QA $ git checkout -b live
  • 27. Git Commands Branching and Merging git merge Merge a branch context into your current one $ git branch $ git merge QA git log Show commit history of a branch $ git log
  • 28. Git Commands Branching and Merging git tag Tag a point in history as important $ git tag -a v1.0
  • 29. Git Commands Sharing and Updating Projects git fetch Download new branches and data from remote repository $ git fetch git pull Fetch from a remote repo and try to merge into the current branch $ git pull
  • 30. Git Commands Sharing and Updating Projects git push Push your new branches and data to a remote repository $ git push
  • 31. What's about GitHub? • It’s a Git repository hosting service… but it adds many of its own features • While Git is a command line tool, GitHub provides a web-based graphical interface • It also provides access control and several collaboration features, such as wikis and basic task management tools
  • 32. What's about GitHub? • By default, all projects are public and free. In you want a private project, then pay • You can clone any public repository, follow projects and developers, post comments, etc • It’s becoming the Facebook’s for developers
  • 33. Git in Action! Go to your computer and start playing... 1. Create a new repository on GitHub 2. Clone this repository 3. Add new files 4. Commit and push them 5. Create a new branch and merge files
  • 34. Thank you for your attention! Questions? Just tweet me @nicotourne or mail me at ntourne@beerealit.com beerealit.com
  • 35. More info at... Official Git site http://git-scm.com Some slides http://www.slideshare.net/jomikr/quick-introduction-to-git http://www.slideshare.net/reallyordinary/intro-to-git-for-drupal-7 http://www.slideshare.net/anildigital/git-introduction http://www.slideshare.net/chacon/getting-git Git commands http://gitref.org/basic GitHub site http://github.com