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

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

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
Peter Chang
 
01 - Introduction to Version Control
01 - Introduction to Version Control01 - Introduction to Version Control
01 - Introduction to Version Control
Sergii Shmarkatiuk
 
Git flow for daily use
Git flow for daily useGit flow for daily use
Git flow for daily use
Mediacurrent
 

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

Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
Victor Wong
 
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
Brian K. Vagnini
 

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

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
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
[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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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...
 
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
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

The everyday developer's guide to version control with Git