SlideShare a Scribd company logo
1 of 43
The everyday developer’s
guide to version
control with git
so, what’s git?
“   Git is distributed version control system
    focused on speed, effectivity and real-
    world usability on large projects.
                                    - git-scm.com
basic source control system (example)




       http://hoth.entp.com/output/git_for_designers.html
but why git?
lots of people use it (it’s common)




          http://en.wikipedia.org/wiki/Git_(software)
let’s git started
create (initialize) a repository


  $ cd (project-directory)
  $ git init
  Initialized empty Git repository in .git/
your first save (commit)


 $ git commit -m 'Initial commit'
create some files


 $ touch README
see what’s changed


 $ git status
 # On branch master
 #
 # Initial commit
 #
 # Untracked files:
 #   (use "git add <file>..." to include in what will be committed)
 #
 # README
 nothing added to commit but untracked files present (use "git add" to
 track)
adding files

 Adding a individual file
 $ git add README




 Adding a multiple files
 $ git add .
see what’s changed (again)


 $ git status
 #   On branch master
 #
 #   Initial commit
 #
 #   Changes to be committed:
 #     (use "git rm --cached <file>..." to unstage)
 #
 #   new file: README
 #
save (commit) your changes


 $ git commit -m 'Added README file'
 Created initial commit c1195b5: Added README file
  0 files changed, 0 insertions(+), 0 deletions(-)
  create mode 100644 README
check your history


 $ git log

 commit c1195b51d6e99dcc6e88b6ae44eea20ba1f0868e
 Author: Erin Carter <me@erincarter.com>
 Date:   Thu Oct 29 12:21:24 2009 -0500

    Added README file
developing with git
undoing your changes


 $ git checkout README
reverting to specific version


 $ git checkout
 3607253d20c7a295965f798109f9d4af0fbeedd8 <file name>
reverting back


 $ git reset HEAD <file name>
developing parallel with branching




       http://hoth.entp.com/output/git_for_designers.html
create a branch


 $ git checkout -b bugfix

 Switched to a new branch “bugfix”
switching branches


 $ git status

 # On branch bugfix
 nothing to commit (working directory clean)

 $ git checkout master

 Switched to branch “master”
collaborating with git
public repos = free
            private repos = cheap



http://github.com
clone a hosted repository


 $ git clone git://github.com/git/hello-
 world.git
 Initialized empty Git repository in /Users/me/Projects/hello-
 world/.git/
 remote: Counting objects: 158, done.
 remote: Compressing objects: 100% (79/79), done.
 remote: Total 158 (delta 54), reused 157 (delta 54)
 Receiving objects: 100% (158/158), 15.62 KiB, done.
 Resolving deltas: 100% (54/54), done.


 $ cd hello-world
pull changes (and pull often)


 $ git pull origin master
add changes to master


 $ git checkout master

 $ git merge bugfix
push changes


 $ git push origin master
configure & customize git
configuring


 $ git config --global user.name "Erin Carter"
 $ git config --global user.email "me@erincarter.com"
add pretty colors


 $ git config --global color.diff auto
 $ git config --global color.status auto
 $ git config --global color.branch auto
git tools
gitk




       usually comes with git - http://gitk.sourceforge.net/
GitX




       http://gitx.frim.nl
TortoiseGit




       http://code.google.com/p/tortoisegit/
git resources
Pro Git (book)




       free online at http://progit.org/book/
Pragmatic Version Control Using Git (book)




 http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git
Git Community Book




        http://book.git-scm.com/
Git Cheat Sheet




  http://ktown.kde.org/~zrusin/git/git-cheat-sheet-large.png
what to remember


  ‣   commit often
  ‣   pull often
  ‣   use checkout and reset with caution
  ‣   create your own repository anywhere


        http://hoth.entp.com/output/git_for_designers.html
fin
@erincarter
me@erincarter.com
linkedin.com/in/erincarter



illustrations by Simon Oxley of idokungfood.com
theme inspired by Scott Chacon’s git-scm.com

More Related Content

What's hot (20)

Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git in 10 minutes
Git in 10 minutesGit in 10 minutes
Git in 10 minutes
 
Grokking opensource with github
Grokking opensource with githubGrokking opensource with github
Grokking opensource with github
 
Git
GitGit
Git
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
git and github
git and githubgit and github
git and github
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git Version Control System
Git Version Control SystemGit Version Control System
Git Version Control System
 
Intro to Git and GitHub
Intro to Git and GitHubIntro to Git and GitHub
Intro to Git and GitHub
 
Learning git
Learning gitLearning git
Learning git
 
Git slides
Git slidesGit slides
Git slides
 
Git n git hub
Git n git hubGit n git hub
Git n git hub
 

Viewers also liked

Version Control System
Version Control SystemVersion Control System
Version Control Systemguptaanil
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?Leonid Mamchenkov
 
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
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git RightSven Peters
 
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
 
Intro To Version Control
Intro To Version ControlIntro To Version Control
Intro To Version Controlceardach
 
An introduction to Version Control Systems
An introduction to Version Control SystemsAn introduction to Version Control Systems
An introduction to Version Control SystemsJon Warbrick
 
Introduction to Version Control System for Windows
Introduction to Version Control System for WindowsIntroduction to Version Control System for Windows
Introduction to Version Control System for WindowsPeter Chang
 
Version Control Systems - ArabNet Beirut 2014 - Dani Arnaout
Version Control Systems - ArabNet Beirut 2014 - Dani ArnaoutVersion Control Systems - ArabNet Beirut 2014 - Dani Arnaout
Version Control Systems - ArabNet Beirut 2014 - Dani ArnaoutDani Arnaout
 
Distributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialDistributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialTed Naleid
 
01 - Introduction to Version Control
01 - Introduction to Version Control01 - Introduction to Version Control
01 - Introduction to Version ControlSergii Shmarkatiuk
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systemsTim Staley
 
Customer Driven Requirements
Customer Driven RequirementsCustomer Driven Requirements
Customer Driven RequirementsStephanie BySouth
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily useMediacurrent
 
Version Control with SVN
Version Control with SVNVersion Control with SVN
Version Control with SVNPHPBelgium
 

Viewers also liked (20)

Version Control System
Version Control SystemVersion Control System
Version Control System
 
What is version control software and why do you need it?
What is version control software and why do you need it?What is version control software and why do you need it?
What is version control software and why do you need it?
 
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
 
Git Tutorial 教學
Git Tutorial 教學Git Tutorial 教學
Git Tutorial 教學
 
Getting Git Right
Getting Git RightGetting Git Right
Getting Git Right
 
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
 
Intro To Version Control
Intro To Version ControlIntro To Version Control
Intro To Version Control
 
An introduction to Version Control Systems
An introduction to Version Control SystemsAn introduction to Version Control Systems
An introduction to Version Control Systems
 
Introduction to Version Control System for Windows
Introduction to Version Control System for WindowsIntroduction to Version Control System for Windows
Introduction to Version Control System for Windows
 
Version Control Systems - ArabNet Beirut 2014 - Dani Arnaout
Version Control Systems - ArabNet Beirut 2014 - Dani ArnaoutVersion Control Systems - ArabNet Beirut 2014 - Dani Arnaout
Version Control Systems - ArabNet Beirut 2014 - Dani Arnaout
 
Distributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With MercurialDistributed Version Control (DVCS) With Mercurial
Distributed Version Control (DVCS) With Mercurial
 
Version control
Version controlVersion control
Version control
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
01 - Introduction to Version Control
01 - Introduction to Version Control01 - Introduction to Version Control
01 - Introduction to Version Control
 
A brief introduction to version control systems
A brief introduction to version control systemsA brief introduction to version control systems
A brief introduction to version control systems
 
Intro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucketIntro to Git, GitHub, and BitBucket
Intro to Git, GitHub, and BitBucket
 
Customer Driven Requirements
Customer Driven RequirementsCustomer Driven Requirements
Customer Driven Requirements
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
 
Agile Management for business
Agile Management for businessAgile Management for business
Agile Management for business
 
Version Control with SVN
Version Control with SVNVersion Control with SVN
Version Control with SVN
 

Similar to The everyday developer's guide to version control with Git

Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshopthemystic_ca
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHubLucas Videla
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)bryanbibat
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Ashok Kumar
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Brian K. Vagnini
 
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Mizan Riqzia
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for ArtistsDavid Newbury
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commandsZakaria Bouazza
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in UnityRifauddin Tsalitsy
 

Similar to The everyday developer's guide to version control with Git (20)

Introduction To Git Workshop
Introduction To Git WorkshopIntroduction To Git Workshop
Introduction To Git Workshop
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Git github
Git githubGit github
Git github
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Git101
Git101Git101
Git101
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
 
Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)Git Ninja KT (GitHub to GitLab)
Git Ninja KT (GitHub to GitLab)
 
Loading...git
Loading...gitLoading...git
Loading...git
 
Gittalk
GittalkGittalk
Gittalk
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
 
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Wokshop de Git
Wokshop de Git Wokshop de Git
Wokshop de Git
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
 
Git setuplinux
Git setuplinuxGit setuplinux
Git setuplinux
 
GitSetupLinux
GitSetupLinuxGitSetupLinux
GitSetupLinux
 
Github By Nyros Developer
Github By Nyros DeveloperGithub By Nyros Developer
Github By Nyros Developer
 
Git
GitGit
Git
 

Recently uploaded

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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 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
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

The everyday developer's guide to version control with Git