Page 1 TBD 12/08/2014 Formation GIT Laurent Kappel Groupe SII 65, rue de Bercy Paris Tél : Fax :
Page 2 TBD Sommaire 12/08/2014 Git is Fast GIT is Distributed GIT is SCM Git is Reliable Using Git Git is Agile Git Re-Writing History Git Workflow
Page 3 TBD GIT is SCM « branch » « merge »
Page 4 TBD Panorama des SCM
Page 5 TBD A little about history …
Page 6 TBD Git is not an evolution
Page 7 TBD Who is using Git
Page 8 TBD GIT is Distributed Distributed Fast Reliable
Page 9 TBD Centralized SCM Single Point of Failure Network (slow) Access Rights?
Page 10 TBD Git is Distributed No a priori structure But Git ≠ Anarchy
Page 11 TBD Git is Distributed A very common practice: Sharing via user-owned repos READ ONLY RD/WR
Page 12 TBD Git is Distributed A very common practice: Sharing via user-owned repos Git Hosting: :
Page 13 TBD Git is Distributed Hosted
Page 14 TBD Distributed Workflow Example Integration-Manager Dictator & Lieutenants
Page 15 TBD Distributed Workflow Example Other developers only READ Only Dan may WRITE New Release develop, commit Share Features Integrate Features
Page 16 TBD Distributed Workflow Example Integration-Manager Dictator & Lieutenants
Page 17 TBD Distributed Workflow Example
Page 18 TBD GIT Avantages Distributed Fast Reliable
Page 19 TBD GIT is Fast 100% local
Page 20 TBD GIT is Fast
Page 21 TBD GIT is Fast
Page 22 TBD GIT is Fast
Page 23 TBD GIT is Fast
Page 24 TBD GIT is Fast
Page 25 TBD GIT is Fast
Page 26 TBD GIT is Fast
Page 27 TBD GIT is Fast
Page 28 TBD GIT is Fast
Page 29 TBD GIT is Fast
Page 30 TBD GIT is Fast
Page 31 TBD GIT is Fast
Page 32 TBD Git Object Database
Page 33 TBD Git Object Database
Page 34 TBD Git Object Database
Page 35 TBD Git Object Database
Page 36 TBD Git Object Database
Page 37 TBD Git Object Database
Page 38 TBD Git Object Database
Page 39 TBD Git Object Database
Page 40 TBD Git Object Database
Page 41 TBD Git Object Database
Page 42 TBD Git Object Database
Page 43 TBD Git Object Database
Page 44 TBD Git Object Database
Page 45 TBD Git Object Database
Page 46 TBD Git Object Database
Page 47 TBD Git Object Database
Page 48 TBD Git Object Database
Page 49 TBD Git Object Database $ git cat-file -p 8e8eb67 tree 91dc8d579f123918f3ac43af1e9377a b author Laurent Kappel committer Laurent Kappel Mon premier commit
Page 50 TBD Git Object Database
Page 51 TBD Git Object Database $ git tag -a v2.0 -m 'my version 2.0' $ cat.git/refs/tags/v2.0
Page 52 TBD Git Object Database
Page 53 TBD This makes Git Fast Restore an arbitrary version – Git: checkout a hash = O(1) – SVN: diffs between n last commits = O(n) Compare 2 revisions Reset Search through history And many more…
Page 54 TBD Some Benchmarking
Page 55 TBD Git is Reliable Distributed Fast Reliable
Page 56 TBD Git is Reliable 1.Because it’s Distributed Single dev with a remote? => 2 copies (local, remote) .git/ has it all 2.Checksums (SHA-1) for all objects Git uses Detects data corruption Guarantees Authenticity
Page 57 TBD Using Git
Page 58 TBD Using Git $ git clone Cloning into ‘gitdoc'... remote: Counting objects: 67870, done. remote: Compressing objects: 100% (13454/13454), done. remote: Total (delta 49179), reused (delta 48872) Receiving objects: 100% (67870/67870), MiB | 5.15 MiB/s, done. Resolving deltas: 100% (49179/49179), done. $ cd gitdoc $ ls –a... ppt.git.gitignore LICENSE README Local Repo Working Directory
Page 59 TBD Using Git $ git remote –v origin (fetch) origin (push) $ git branch * master $ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master $ git log -n 3 --oneline 424a7b2 Merge pull request #202 from g-oikonomou/cc2538-minor-fixes c Change the InfoPage Location of the IEEE address 8b5b2bd CC2538 Documentation typo and grammar fixes
Page 60 TBD Using Git
Page 61 TBD Using Git
Page 62 TBD Using Git
Page 63 TBD Using Git
Page 64 TBD Using Git Modification of tracked content Modification of tracked content New, untracked content
Page 65 TBD Using Git
Page 66 TBD Using Git Content of the next commit Content of the next commit
Page 67 TBD Using Git
Page 68 TBD Using Git
Page 69 TBD Using Git
Page 70 TBD Using Git
Page 71 TBD Using Git
Page 72 TBD Using Git
Page 73 TBD Using Git Merges are done LOCALLY! “Git push failed, To prevent from losing history, non-fast forward updates were rejected” Not an error, but common-sense Files are rarely decorrelated
Page 74 TBD Using Git
Page 75 TBD Using Git
Page 76 TBD Using Git
Page 77 TBD Using Git Still not permitted Git is happy But how can PROJECT authors trust you?
Page 78 TBD Using Git $ git remote add cetic
Page 79 TBD Using Git $ git remote add cetic git push cetic master OK alias du remote nom utilisateur
Page 80 TBD Using Git $ git remote add cetic $ git push cetic master OK New repo = 2 commands ! Remote Repo $ git push [remote] [branch] $ git push [remote] [branch[:alias]] alias remote branch
Page 81 TBD Using Git
Page 82 TBD Using Git
Page 83 TBD Using Git
Page 84 TBD Using Git Jan Krüger’s Cheat Sheet
Page 85 TBD Using Git Git LOVES branches, and so should you
Page 86 TBD Git is Agile
Page 87 TBD Git is Agile
Page 88 TBD Git is Agile
Page 89 TBD Git is Agile
Page 90 TBD Git is Agile
Page 91 TBD Git is Agile
Page 92 TBD Git is Agile
Page 93 TBD Git is Agile
Page 94 TBD Git is Agile
Page 95 TBD Git is Agile
Page 96 TBD Re-Writing History
Page 97 TBD Re-Writing History
Page 98 TBD Re-Writing History git rebase –i 8b5b2bd
Page 99 TBD Re-Writing History
Page 100 TBD Re-Writing History
Page 101 TBD Re-Writing History
Page 102 TBD Re-Writing History
Page 103 TBD Re-Writing History
Page 104 TBD Cherry-Picking
Page 105 TBD Cherry-Picking
Page 106 TBD Cherry-Picking
Page 107 TBD Others commands
Page 108 TBD Workflow – How to structure a repository Branches and their interactions How the project moves forward – Organizing people Who accesses what How are contributions merged? Where? By who? Responsibilities Working together with Git « Workflow » ?
Page 109 TBD GitFlow
Page 110 TBD GitFlow
Page 111 TBD GitFlow
Page 112 TBD GitFlow
Page 113 TBD GitFlow
Page 114 TBD GitFlow
Page 115 TBD GitFlow
Page 116 TBD Workflow – How to structure a repository Branches and their interactions How the project moves forward – Organizing people Who accesses what How are contributions merged? Where? By who? Responsibilities Working together with Git « Workflow » ?
Page 117 TBD Integration Manager Workflow
Page 118 TBD Dictator & Lieutenants Workflow
Page 119 TBD Getting Started with Git Book: Pro Git. Selected Tutorials: – Git Immersion – Learn Git Branching workflow : interactive : More material: –
Page 120 TBD The End Questions ? Thanks !