SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Git ?
Mais non c’est pas compliqué ...
Git en résumé

DVCS (Distributed Version Control
System)

Rapide

Simple à configurer

Github
Git ≠ SVN

Commit local       Commit distant

Un commit est un   Un commit est un
snapshot           delta de fichiers

Une branche        Une branche est un
n’est qu’un        copié/collé du
commit             projet
Clone
Clone et init


$ git clone git@github.com:ep-
factory/artilinki.git



$ git init
Cycle de vie

untracked         unmodified      modified           staged


                           edit
            add
                                             stage


        remove
                                   commit
Commit
$ git add monfichier

$ git commit -(a)m ‘message’


Message court d’une seule ligne et
éventuellement plus d’explications
après un saut de ligne

Organiser ses commit logiquement
Un commit ...
Des commits ...
Infos utiles

$ git status (-s)

$ git diff commit1 commit2

$ git log (et 2x10³² options)

$ git show <object>
Push, Pull, Remote
Remote


$ git remote -v

$ git remote add git@github.com:ep-
factory/artilinki.git

$ git remote rm origin
Fetch/Pull
$ git fetch (--all)

$ git merge origin/branch



Pull fait la même chose mais merge
automatiquement les données

$ git pull (--all)
Push


Push les commits locaux et les
éventuelles branches

$ git push origin master

$ git push --all
Branches
Branch, Checkout

$ git branch

$ git branch mabranche

$ git branch -d mabranche

$ git checkout (-b) mabranche
$ git branch testing




$ git checkout testing
$ git commit -am ‘message’
HEAD ?
C’est un pointeur vers
 la branche courante

 $ git checkout master




HEAD, HEAD^, HEAD~2 ...
$ git checkout master
$ git commit -am ‘message’
Merge et Rebase
Merge
Merge vs Rebase 1
Merge vs Rebase 2
Merge vs Rebase 3
J’ai tout cassé ...
... ça se répare

$ git commit --amend

$ git reset monfichier

$ git checkout -- monfichier

$ git revert <commit>

$ git reset --hard (HEAD)
Workflow

Master

Develop

Release-x.y.z

Hotfix-x.y.z

Feature
Références

http://progit.org

http://gitref.org

http://book.git-scm.com

www.gitready.com

http://nvie.com/posts/a-successful-
git-branching-model/
Questions ?

Weitere ähnliche Inhalte

Ähnlich wie Introduction à Git

Découvrir et utiliser Git : le logiciel de gestion de versions décentralisé
Découvrir et utiliser Git : le logiciel de gestion de versions décentraliséDécouvrir et utiliser Git : le logiciel de gestion de versions décentralisé
Découvrir et utiliser Git : le logiciel de gestion de versions décentraliséECAM Brussels Engineering School
 
Débuter avec Git & github
Débuter avec Git & githubDébuter avec Git & github
Débuter avec Git & githubMonoem Youneb
 
Introduction à git.pdf
Introduction à git.pdfIntroduction à git.pdf
Introduction à git.pdfbadrfathallah2
 
Drupalcamp Nantes - Présentation GIT
Drupalcamp Nantes - Présentation GITDrupalcamp Nantes - Présentation GIT
Drupalcamp Nantes - Présentation GITArtusamak
 
JCertif 2012 : Git par la pratique
JCertif 2012 : Git par la pratiqueJCertif 2012 : Git par la pratique
JCertif 2012 : Git par la pratiqueRossi Oddet
 
Présentation de git
Présentation de gitPrésentation de git
Présentation de gitJulien Blin
 
Initiation à Git, GitHub2.pdf
Initiation à Git, GitHub2.pdfInitiation à Git, GitHub2.pdf
Initiation à Git, GitHub2.pdfmouad55
 
Git pour les (pas si) nuls
Git pour les (pas si) nulsGit pour les (pas si) nuls
Git pour les (pas si) nulsMalk Zameth
 
Petit Déjeuner Git chez Makina Corpus
Petit Déjeuner Git chez Makina CorpusPetit Déjeuner Git chez Makina Corpus
Petit Déjeuner Git chez Makina Corpusleplatrem
 
Git workflow
Git workflowGit workflow
Git workflowPMSIpilot
 
Comment maitriser git et produire de beaux commits
Comment maitriser git et produire de beaux commitsComment maitriser git et produire de beaux commits
Comment maitriser git et produire de beaux commitsJulien Maitrehenry
 

Ähnlich wie Introduction à Git (20)

Introduction à git
Introduction à gitIntroduction à git
Introduction à git
 
Découvrir et utiliser Git : le logiciel de gestion de versions décentralisé
Découvrir et utiliser Git : le logiciel de gestion de versions décentraliséDécouvrir et utiliser Git : le logiciel de gestion de versions décentralisé
Découvrir et utiliser Git : le logiciel de gestion de versions décentralisé
 
Débuter avec Git & github
Débuter avec Git & githubDébuter avec Git & github
Débuter avec Git & github
 
Git pratique
Git pratiqueGit pratique
Git pratique
 
Git pratique
Git pratiqueGit pratique
Git pratique
 
Introduction à git.pdf
Introduction à git.pdfIntroduction à git.pdf
Introduction à git.pdf
 
SVN to GitHUb
SVN to GitHUbSVN to GitHUb
SVN to GitHUb
 
Drupalcamp Nantes - Présentation GIT
Drupalcamp Nantes - Présentation GITDrupalcamp Nantes - Présentation GIT
Drupalcamp Nantes - Présentation GIT
 
3_SCM_Git.pdf
3_SCM_Git.pdf3_SCM_Git.pdf
3_SCM_Git.pdf
 
GIT Fundamentals
GIT FundamentalsGIT Fundamentals
GIT Fundamentals
 
Git and Github.pptx
Git and Github.pptxGit and Github.pptx
Git and Github.pptx
 
JCertif 2012 : Git par la pratique
JCertif 2012 : Git par la pratiqueJCertif 2012 : Git par la pratique
JCertif 2012 : Git par la pratique
 
Git
GitGit
Git
 
Présentation de git
Présentation de gitPrésentation de git
Présentation de git
 
Initiation à Git, GitHub2.pdf
Initiation à Git, GitHub2.pdfInitiation à Git, GitHub2.pdf
Initiation à Git, GitHub2.pdf
 
Git pour les (pas si) nuls
Git pour les (pas si) nulsGit pour les (pas si) nuls
Git pour les (pas si) nuls
 
Petit Déjeuner Git chez Makina Corpus
Petit Déjeuner Git chez Makina CorpusPetit Déjeuner Git chez Makina Corpus
Petit Déjeuner Git chez Makina Corpus
 
Git workflow
Git workflowGit workflow
Git workflow
 
git-cmds-base.pdf
git-cmds-base.pdfgit-cmds-base.pdf
git-cmds-base.pdf
 
Comment maitriser git et produire de beaux commits
Comment maitriser git et produire de beaux commitsComment maitriser git et produire de beaux commits
Comment maitriser git et produire de beaux commits
 

Introduction à Git

Hinweis der Redaktion