SlideShare une entreprise Scribd logo
1  sur  44
Télécharger pour lire hors ligne
GIT IT ON
a hands on presentation by
@martinbing
GIT WHAT?
Open Source
Distributed Version Control System (DVCS)
(VCS) aka Source Code Management (SCM)
Tool to keep track of changes (in files)
Command Line (BASH)
Supported by UNIX-like systems (Linux, Mac OS X, Solaris)
and Windows
VERSION CONTROL SYSTEMS
Local
Centralized
Distributed
LOCAL VERSION CONTROL SYSTEM
CENTRALIZED VERSION CONTROL SYSTEM
DISTRIBUTED VERSION CONTROL SYSTEM
HISTORY
GIT created in 2005 by Linus Torvalds
Developed on a Linux (what else?)
Made in 2 weeks
Why pay if you can build it better (ref. BitKeeper)
See the man in action: Linus Torvalds on Git
PREDECESSORS
(SCCS) Source Code Control System
1972, closed source (FIFO)
(RCS) Revision Control System
1982, open source (LIFO)
(CVS) Concurrent Versions System
1986-1990, open source (+users on 1 file)
(SVN) Apache Subversion
2000, open source (+non-txt-files)
(SCM) BitKeeper
2000, closed source, proprietary
free 'community version' till april 2005
(used for linux kernel 2002-2005)
WHY USE GIT?
To check edits (code)
review history log of changes
view diff between versions
retrieve old versions
To share changes with collabs
GIT BASICS
!!! GIT CAN NOT TRACK !!!
Non-text files
binary files (imgs etc..)
Word Processing files
Spreadsheets
PDF's
GIT WHO?
People NOT afraid of command-line tools
Programmers & developers
mainly used languages:
HTML
CSS
JavaScript
...
HANDS ON..?
SET UP GIT
DOWNLOAD:
INSTALL
See guidelines
or following slides to view the set up process
(Windows)
http://git-scm.com/downloads
here
GIT UP SET
Create an account on:
username :
email:
https://github.com/signup/free
$ git config --global user.name "Your name here"
# Sets the default name for git to use when you commit
$ git config --global user.email "Your email here"
# Sets the default email for git to use when you commit
GIT BASH
# some BASH commands you will use quite often from now on:
$ ls #show contents of directory you are in
$ cd Documents
$ mkdir git_mb
$ cd git_mb
$ git init #initialise this working directory as a new repo
$ touch README.md
$ vi README.md
# you can edit this file in any text based editor like notepad
GIT STATUS
Martin@MB-PC ~/Documents/git_mb (master)
$ git status
# On branch master
#
# Initial Commit
#
# Untracked files:
# (use "git add <file>... " to include in what will be committed)
#
# README.md
nothing added to commit but untracked files present (use "git add"
to track)
Martin@MB-PC ~/Documents/git_mb (master)
$
GIT ADD
Martin@MB-PC ~/Documents/git_mb (master)
$ git add README.md
Martin@MB-PC ~/Documents/git_mb (master)
$ git status
# On branch master
#
# Initial Commit
#
# Changes to be committed:
# (use "git rm --cached <file>... " to unstage)
#
# new file:README.md
#
Martin@MB-PC ~/Documents/git_mb (master)
$
GIT COMMIT
Martin@MB-PC ~/Documents/git_mb (master)
$ git commit -m 'Initialise repo and creation of readme file'
[master (root-commit) e881faa] initialise repo and creation
of readme file
1 file changed, 1 insertion(+)
create mode 100644 README.md
Martin@MB-PC ~/Documents/git_mb (master)
$ git status
# On branch master
nothing to commit, working directory clean
Martin@MB-PC ~/Documents/git_mb (master)
$
GIT LOG
Martin@MB-PC ~/Documents/git_mb (master)
$ git log
commit e881faa051b1fb5e51074e05e88a744349cb97a6
Author: MBing <email@somedomain.com>
Date: Mon Jun 3 22:38:32 2013 +0200
Initialise repo and creation of readme file
Martin@MB-PC ~/Documents/git_mb (master)
$
I GIT... EUH LOST?!?
Git Architecture simplified:
WHAT IS GITHUB?
Web Based Hosting Service for
software development
Uses Git revision control system
Free for open source repo's
Paid plans available for private repo's
easy to use GUI's available
Makes the use of Git easier for most people
https://help.github.com/
GITHUB REPO
click to see the online tutorial on GitHubhere
GITHUB - FORK A REPO
GITHUB CLONE
This is your own folder, not the original repo!!
(look for your username in the git uri)
GIT CLONE
Martin@MB-PC ~/Documents/git_mb (master)
$ git clone https://github.com/yourusername/GIT-presentation.git
Cloning into 'GIT-presentation'...
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
Martin@MB-PC ~/Documents/git_mb (master)
$ ls
GIT-presentation
$ cd GIT-presentation/
$ ls
README.md
Martin@MB-PC ~/Documents/git_mb (master)
$
GIT ADD NEW FILE
Martin@MB-PC ~/Documents/GIT-presentation (master)
$ touch yourname.html
Martin@MB-PC ~/Documents/GIT-presentation (master)
$ git status
# On branch master
# Untracked files:
# (use "git add <file> ..." to include in what will be committed)
#
# yourname.html
nothing added to commit but untracked files present (use git
"git add" to track)
Martin@MB-PC ~/Documents/GIT-presentation (master)
$
GIT ADD
Martin@MB-PC ~/Documents/GIT-presentation (master)
$ git add yourname.html
Martin@MB-PC ~/Documents/GIT-presentation (master)
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>... " to unstage)
#
# new file: yourname.html
#
Martin@MB-PC ~/Documents/GIT-presentation (master)
$
GIT COMMIT
Martin@MB-PC ~/Documents/GIT-presentation (master)
$ git commit -m 'adding an html file with my name'
[master 328e0cb] adding an html file with my name
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 yourname.html
Martin@MB-PC ~/Documents/GIT-presentation (master)
$ git status
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
# (use "git push" to publish your local commits)
#
nothing to commit, working directory clean
Martin@MB-PC ~/Documents/GIT-presentation (master)
$
GIT PUSH
Martin@MB-PC ~/Documents/GIT-presentation (master)
$ git push origin master
Counting objects: 4 done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 302 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://github.com/yourname/GIT-presentation.git
ad764dc..328e0cb master -> master
Martin@MB-PC ~/Documents/GIT-presentation (master)
$ git status
# On branch master
nothing to commit, working directory clean
Martin@MB-PC ~/Documents/GIT-presentation (master)
$
GO AND WATCH GITHUB
OTHER THINGS YOU CAN DO WITH GIT
fetch
merge
checkout
branch
diff
pull
show
reset
...
RESOURCES
The Pro Git book by Scott Chacun:
Heroku Cheat Sheet :
YouTube:
(Patrick Hogan)
http://git-scm.com/book
Cheat Sheet PDF file link
Introduction to Git with Scott Chacun
Power Your Workflow with Git
GIT STARTED!

Contenu connexe

Tendances

Tendances (20)

Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
Gitting out of trouble
Gitting out of troubleGitting out of trouble
Gitting out of trouble
 
Git
GitGit
Git
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
 
Git - Get Ready To Use It
Git - Get Ready To Use ItGit - Get Ready To Use It
Git - Get Ready To Use It
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git learn from scratch
Git learn from scratchGit learn from scratch
Git learn from scratch
 
Exprimiendo GIT
Exprimiendo GITExprimiendo GIT
Exprimiendo GIT
 
Advanted git
Advanted git Advanted git
Advanted git
 
Git introduction
Git introductionGit introduction
Git introduction
 
Presentacion git
Presentacion gitPresentacion git
Presentacion git
 
Basic git
Basic gitBasic git
Basic git
 
Git and fundamentals
Git and fundamentalsGit and fundamentals
Git and fundamentals
 
Basic Git
Basic GitBasic Git
Basic Git
 
Git and github introduction
Git and github introductionGit and github introduction
Git and github introduction
 
Get Good With Git
Get Good With GitGet Good With Git
Get Good With Git
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Git intro hands on windows with msysgit
Git intro hands on windows with msysgitGit intro hands on windows with msysgit
Git intro hands on windows with msysgit
 
Git for beginner
Git for beginnerGit for beginner
Git for beginner
 

En vedette

Increase Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web ServicesIncrease Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web ServicesAmazon Web Services
 
Git and git hub
Git and git hubGit and git hub
Git and git hub唯 李
 
Git hub for designers
Git hub for designersGit hub for designers
Git hub for designersFITC
 
Git hub plugin setup and working with Git hub on anypoint studio
Git hub plugin setup and working with Git hub on anypoint studioGit hub plugin setup and working with Git hub on anypoint studio
Git hub plugin setup and working with Git hub on anypoint studioSudha Ch
 
Amazon Web service Aws
Amazon Web service Aws Amazon Web service Aws
Amazon Web service Aws Ahmed Gamil
 

En vedette (7)

Increase Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web ServicesIncrease Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web Services
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
Git and git hub
Git and git hubGit and git hub
Git and git hub
 
Git hub for designers
Git hub for designersGit hub for designers
Git hub for designers
 
Git hub plugin setup and working with Git hub on anypoint studio
Git hub plugin setup and working with Git hub on anypoint studioGit hub plugin setup and working with Git hub on anypoint studio
Git hub plugin setup and working with Git hub on anypoint studio
 
Amazon Web service Aws
Amazon Web service Aws Amazon Web service Aws
Amazon Web service Aws
 
Getting Git
Getting GitGetting Git
Getting Git
 

Similaire à Git it on (includes git hub)

Git Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityGit Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityRaja Soundaramourty
 
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
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)bryanbibat
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceForest Mars
 
Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)chenghlee
 
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Mizan Riqzia
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about gitSothearin Ren
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?9 series
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginnersbryanbibat
 
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 Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting StartedWildan Maulana
 

Similaire à Git it on (includes git hub) (20)

Git Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityGit Concepts, Commands and Connectivity
Git Concepts, Commands and Connectivity
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git_real_slides
Git_real_slidesGit_real_slides
Git_real_slides
 
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
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Git Basics (Professionals)
 Git Basics (Professionals) Git Basics (Professionals)
Git Basics (Professionals)
 
Git and github
Git and githubGit and github
Git and github
 
Git and Github
Git and GithubGit and Github
Git and Github
 
GTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSourceGTFO: Git Theory For OpenSource
GTFO: Git Theory For OpenSource
 
簡單介紹git
簡單介紹git簡單介紹git
簡單介紹git
 
Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)Intro to git (UT biocomputing 2015)
Intro to git (UT biocomputing 2015)
 
Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)Nge-GIT (Belajar Git Bareng)
Nge-GIT (Belajar Git Bareng)
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
 
Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git training
Git trainingGit training
Git training
 
Git Workshop : Getting Started
Git Workshop : Getting StartedGit Workshop : Getting Started
Git Workshop : Getting Started
 
Hello git
Hello git Hello git
Hello git
 

Dernier

KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...Cara Menggugurkan Kandungan 087776558899
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)Delhi Call girls
 
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)Delhi Call girls
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfpastor83
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morvikas rana
 
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)Delhi Call girls
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theorydrae5
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...PsychicRuben LoveSpells
 
the Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentationthe Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentationbrynpueblos04
 
WOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptxWOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptxpadhand000
 
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)Delhi Call girls
 

Dernier (14)

KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
KLINIK BATA Jual obat penggugur kandungan 087776558899 ABORSI JANIN KEHAMILAN...
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
(Anamika) VIP Call Girls Navi Mumbai Call Now 8250077686 Navi Mumbai Escorts ...
 
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Dashrath Puri (Delhi)
 
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Jasola (Delhi)
 
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
(Aarini) Russian Call Girls Surat Call Now 8250077686 Surat Escorts 24x7
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Morcall Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
call Now 9811711561 Cash Payment乂 Call Girls in Dwarka Mor
 
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Palam (Delhi)
 
Pokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy TheoryPokemon Go... Unraveling the Conspiracy Theory
Pokemon Go... Unraveling the Conspiracy Theory
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
 
the Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentationthe Husband rolesBrown Aesthetic Cute Group Project Presentation
the Husband rolesBrown Aesthetic Cute Group Project Presentation
 
WOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptxWOMEN EMPOWERMENT women empowerment.pptx
WOMEN EMPOWERMENT women empowerment.pptx
 
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
2k Shots ≽ 9205541914 ≼ Call Girls In Mukherjee Nagar (Delhi)
 

Git it on (includes git hub)

  • 1. GIT IT ON a hands on presentation by @martinbing
  • 2. GIT WHAT? Open Source Distributed Version Control System (DVCS) (VCS) aka Source Code Management (SCM) Tool to keep track of changes (in files) Command Line (BASH) Supported by UNIX-like systems (Linux, Mac OS X, Solaris) and Windows
  • 7. HISTORY GIT created in 2005 by Linus Torvalds Developed on a Linux (what else?) Made in 2 weeks Why pay if you can build it better (ref. BitKeeper) See the man in action: Linus Torvalds on Git
  • 8. PREDECESSORS (SCCS) Source Code Control System 1972, closed source (FIFO) (RCS) Revision Control System 1982, open source (LIFO) (CVS) Concurrent Versions System 1986-1990, open source (+users on 1 file) (SVN) Apache Subversion 2000, open source (+non-txt-files) (SCM) BitKeeper 2000, closed source, proprietary free 'community version' till april 2005 (used for linux kernel 2002-2005)
  • 9. WHY USE GIT? To check edits (code) review history log of changes view diff between versions retrieve old versions To share changes with collabs
  • 11. !!! GIT CAN NOT TRACK !!! Non-text files binary files (imgs etc..) Word Processing files Spreadsheets PDF's
  • 12. GIT WHO? People NOT afraid of command-line tools Programmers & developers mainly used languages: HTML CSS JavaScript ...
  • 14. SET UP GIT DOWNLOAD: INSTALL See guidelines or following slides to view the set up process (Windows) http://git-scm.com/downloads here
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25. GIT UP SET Create an account on: username : email: https://github.com/signup/free $ git config --global user.name "Your name here" # Sets the default name for git to use when you commit $ git config --global user.email "Your email here" # Sets the default email for git to use when you commit
  • 26. GIT BASH # some BASH commands you will use quite often from now on: $ ls #show contents of directory you are in $ cd Documents $ mkdir git_mb $ cd git_mb $ git init #initialise this working directory as a new repo $ touch README.md $ vi README.md # you can edit this file in any text based editor like notepad
  • 27. GIT STATUS Martin@MB-PC ~/Documents/git_mb (master) $ git status # On branch master # # Initial Commit # # Untracked files: # (use "git add <file>... " to include in what will be committed) # # README.md nothing added to commit but untracked files present (use "git add" to track) Martin@MB-PC ~/Documents/git_mb (master) $
  • 28. GIT ADD Martin@MB-PC ~/Documents/git_mb (master) $ git add README.md Martin@MB-PC ~/Documents/git_mb (master) $ git status # On branch master # # Initial Commit # # Changes to be committed: # (use "git rm --cached <file>... " to unstage) # # new file:README.md # Martin@MB-PC ~/Documents/git_mb (master) $
  • 29. GIT COMMIT Martin@MB-PC ~/Documents/git_mb (master) $ git commit -m 'Initialise repo and creation of readme file' [master (root-commit) e881faa] initialise repo and creation of readme file 1 file changed, 1 insertion(+) create mode 100644 README.md Martin@MB-PC ~/Documents/git_mb (master) $ git status # On branch master nothing to commit, working directory clean Martin@MB-PC ~/Documents/git_mb (master) $
  • 30. GIT LOG Martin@MB-PC ~/Documents/git_mb (master) $ git log commit e881faa051b1fb5e51074e05e88a744349cb97a6 Author: MBing <email@somedomain.com> Date: Mon Jun 3 22:38:32 2013 +0200 Initialise repo and creation of readme file Martin@MB-PC ~/Documents/git_mb (master) $
  • 31. I GIT... EUH LOST?!? Git Architecture simplified:
  • 32. WHAT IS GITHUB? Web Based Hosting Service for software development Uses Git revision control system Free for open source repo's Paid plans available for private repo's easy to use GUI's available Makes the use of Git easier for most people https://help.github.com/
  • 33. GITHUB REPO click to see the online tutorial on GitHubhere
  • 34. GITHUB - FORK A REPO
  • 35. GITHUB CLONE This is your own folder, not the original repo!! (look for your username in the git uri)
  • 36. GIT CLONE Martin@MB-PC ~/Documents/git_mb (master) $ git clone https://github.com/yourusername/GIT-presentation.git Cloning into 'GIT-presentation'... remote: Counting objects: 6, done. remote: Compressing objects: 100% (4/4), done. remote: Total 6 (delta 1), reused 0 (delta 0) Unpacking objects: 100% (6/6), done. Martin@MB-PC ~/Documents/git_mb (master) $ ls GIT-presentation $ cd GIT-presentation/ $ ls README.md Martin@MB-PC ~/Documents/git_mb (master) $
  • 37. GIT ADD NEW FILE Martin@MB-PC ~/Documents/GIT-presentation (master) $ touch yourname.html Martin@MB-PC ~/Documents/GIT-presentation (master) $ git status # On branch master # Untracked files: # (use "git add <file> ..." to include in what will be committed) # # yourname.html nothing added to commit but untracked files present (use git "git add" to track) Martin@MB-PC ~/Documents/GIT-presentation (master) $
  • 38. GIT ADD Martin@MB-PC ~/Documents/GIT-presentation (master) $ git add yourname.html Martin@MB-PC ~/Documents/GIT-presentation (master) $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>... " to unstage) # # new file: yourname.html # Martin@MB-PC ~/Documents/GIT-presentation (master) $
  • 39. GIT COMMIT Martin@MB-PC ~/Documents/GIT-presentation (master) $ git commit -m 'adding an html file with my name' [master 328e0cb] adding an html file with my name 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 yourname.html Martin@MB-PC ~/Documents/GIT-presentation (master) $ git status # On branch master # Your branch is ahead of 'origin/master' by 1 commit. # (use "git push" to publish your local commits) # nothing to commit, working directory clean Martin@MB-PC ~/Documents/GIT-presentation (master) $
  • 40. GIT PUSH Martin@MB-PC ~/Documents/GIT-presentation (master) $ git push origin master Counting objects: 4 done. Delta compression using up to 2 threads. Compressing objects: 100% (2/2), done. Writing objects: 100% (3/3), 302 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To https://github.com/yourname/GIT-presentation.git ad764dc..328e0cb master -> master Martin@MB-PC ~/Documents/GIT-presentation (master) $ git status # On branch master nothing to commit, working directory clean Martin@MB-PC ~/Documents/GIT-presentation (master) $
  • 41. GO AND WATCH GITHUB
  • 42. OTHER THINGS YOU CAN DO WITH GIT fetch merge checkout branch diff pull show reset ...
  • 43. RESOURCES The Pro Git book by Scott Chacun: Heroku Cheat Sheet : YouTube: (Patrick Hogan) http://git-scm.com/book Cheat Sheet PDF file link Introduction to Git with Scott Chacun Power Your Workflow with Git