Coworking with git

Julien Pivotto
Julien PivottoOpen Source Consultant at Inuits
Coworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with git
Collaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for git
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
LOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, Antwerp
April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015
whoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoami
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
• System administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.eu
• Git user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ years
• DevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believer
• Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004
• @roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie on irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/github
inuits.eu
Ops <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 Dev
• Infrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as Code
▶ SSSSSSSSSSSSSSSSSCM all the things
▶ MMMMMMMMMMMMMMMMMonitoring
▶ CCCCCCCCCCCCCCCCConfiguration
▶ AAAAAAAAAAAAAAAAApplication deployment
• Taking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software development
▶ UUUUUUUUUUUUUUUUUnderstanding
▶ MMMMMMMMMMMMMMMMMonitoring
▶ HHHHHHHHHHHHHHHHHigh Availability
▶ ……………………………………………
Me and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and git
• I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)
• Private forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforge
• 5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git
• The Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot git
• GGGGGGGGGGGGGGGGGit/Hg are the de-facto standards in OS
projects
Git is a free and open source distributed version control system
designed to handle everything from small to very large projects
with speed and efficiency.
Source: http://git-scm.com/
git loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit log
• Initiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus Torvalds
• Replacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeper
• Created for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel development
• Now used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projects
git is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributed
• EEEEEEEEEEEEEEEEEverything can be done in local (except
pull&push)
• WWWWWWWWWWWWWWWWWork with several remotes
• SSSSSSSSSSSSSSSSShare code with anyone
• NNNNNNNNNNNNNNNNNo unique central repository
• AAAAAAAAAAAAAAAAA lot of workflows possible
A teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA team
• OOOOOOOOOOOOOOOOOne person
• 1111111111111111100 people
• CCCCCCCCCCCCCCCCCoders, testers, readers?
A repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than code
• CCCCCCCCCCCCCCCCCode changes
• CCCCCCCCCCCCCCCCCommit messages
• DDDDDDDDDDDDDDDDDates
• BBBBBBBBBBBBBBBBBranches
• TTTTTTTTTTTTTTTTTags
The Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit Message
The commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit message
• NNNNNNNNNNNNNNNNNever underestimate the commit message
• WWWWWWWWWWWWWWWWWill be seen in many occasions: git logs,
cherry-picks, git blame, …
• AAAAAAAAAAAAAAAAAlways available with the repository, offline
FormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormat
• OOOOOOOOOOOOOOOOOne short line with a ticket number
• <<<<<<<<<<<<<<<<<blank line>
• AAAAAAAAAAAAAAAAA more complete description, with context
RebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasingRebasing
• SSSSSSSSSSSSSSSSStep 1: you pull
• SSSSSSSSSSSSSSSSStep 2: you commit
• SSSSSSSSSSSSSSSSStep 3: colleague push
• SSSSSSSSSSSSSSSSStep 4: you pull
• SSSSSSSSSSSSSSSSStep 5: you push
Coworking with git
Coworking with git
Coworking with git
Coworking with git
d705683 dce1845 7d9d95d 6cea694
dd590b4
ccb3389
85c05ba
ccb3389
Coworking with git
Coworking with git
Before:
d705683 dce1845 7d9d95d 6cea694
dd590b4
ccb3389
85c05ba
ccb3389
After:
d705683 dce1845 7d9d95d dd590b4 6fb1d1a
rebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasing
• CCCCCCCCCCCCCCCCCleaner project history
• LLLLLLLLLLLLLLLLLess commits
• """""""""""""""""Single-line" commit history
• gggggggggggggggggit pull --rebase
SquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashingSquashing
Daily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily work
• SSSSSSSSSSSSSSSSStep 1: code on your branch
• SSSSSSSSSSSSSSSSStep 2: commit
• SSSSSSSSSSSSSSSSStep 3: code again
• SSSSSSSSSSSSSSSSStep 4: commit
• SSSSSSSSSSSSSSSSStep 5: GOTO Step 1
Coworking with git
What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?
A nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changes
A big mess
No one would merge that
4dd6437 8ac0fed 3092c78 f55d65e a4c8b39 2ac72a4 48e6f6f 42b3af2 b7d0830 c0cf800 7df0c0a cfe76f4
Coworking with git
Coworking with git
Coworking with git
Coworking with git
Coworking with git
Coworking with git
Coworking with git
Before:
4dd6437 8ac0fed 3092c78 f55d65e a4c8b39 2ac72a4 48e6f6f 42b3af2 b7d0830 c0cf800 7df0c0a cfe76f4
After:
4dd6437 8ac0fed 3092c78 4fcbe28
git rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -i
• CCCCCCCCCCCCCCCCChanges the git history
• sssssssssssssssssquash, delete, change, reorder commits
• gggggggggggggggggit hashes are unique, any change change
them
The bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro code
Never change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits that
are already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushed
Merge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squash
git merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squash
• TTTTTTTTTTTTTTTTThe merge is done but without commits
• IIIIIIIIIIIIIIIIIt allows you to commit all in once
• EEEEEEEEEEEEEEEEEasily squash a temp branch in a commit
Coworking with git
d705683 dce1845 7d9d95d 6cea694
935c8e1 bcdb4bf 2aac4c7
Coworking with git
d705683 dce1845 7d9d95d 6cea694
2679d42
935c8e1 bcdb4bf 2aac4c7
AmendAmendAmendAmendAmendAmendAmendAmendAmendAmendAmendAmendAmendAmendAmendAmendAmend
git commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amend
• CCCCCCCCCCCCCCCCChange the last commit
• AAAAAAAAAAAAAAAAAdd files, change commit message
• DDDDDDDDDDDDDDDDDo it before pushing!
Coworking with git
Additional tips
Use SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH sockets
$ cat .ssh/config
Host githost
controlmaster auto
controlpath /tmp/ssh-%r@%h:%p
ControlPersist 300
• UUUUUUUUUUUUUUUUUse only one SSH connection
• DDDDDDDDDDDDDDDDDo not disconnect SSH
Find the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commit
$ git name-rev --name-only 106cb38dd0bc5ea2d2d0adef0b40
06bd61884e42
remotes/origin/8.5.2~1
git autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrect
$ git config help.autocorrect 10
$ git pusk
WARNING: You called a Git command named 'pusk', which does not
Continuing under the assumption that you meant 'push'
in 1.0 seconds automatically...
GPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commits
• gggggggggggggggggit commit -S
• SSSSSSSSSSSSSSSSSign PR, merge commits
• DDDDDDDDDDDDDDDDDo not sign every commit (then it becomes
useless)
HomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomework
• gggggggggggggggggit reflog
• gggggggggggggggggit aliases
• gggggggggggggggggit bisect
• gggggggggggggggggit blame
• FFFFFFFFFFFFFFFFFETCH_HEAD
ConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusionConclusion
conclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusion
• GGGGGGGGGGGGGGGGGit is powerful
• AAAAAAAAAAAAAAAAAny commit can be changed
• YYYYYYYYYYYYYYYYYou can do anything
• AAAAAAAAAAAAAAAAA commit = A logical change
• AAAAAAAAAAAAAAAAA clean history brings you easiest
blame/bisect
• RRRRRRRRRRRRRRRRRemember that git is decentralized
Thank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank you
Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?
Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2
ContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContact
Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto
julien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eu
@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie
inuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuits
https://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.eu
info@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.eu
+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636
1 of 58

More Related Content

What's hot(20)

RPM experimentsRPM experiments
RPM experiments
Julien Pivotto1.6K views
Managing a R&D Lab with ForemanManaging a R&D Lab with Foreman
Managing a R&D Lab with Foreman
Julien Pivotto1.6K views
An introduction to the Pulp projectAn introduction to the Pulp project
An introduction to the Pulp project
Julien Pivotto9.6K views
Getting the maximum out of systemdGetting the maximum out of systemd
Getting the maximum out of systemd
Julien Pivotto8.6K views
systemd and configuration managementsystemd and configuration management
systemd and configuration management
Julien Pivotto2.9K views
Introduction to GitlabIntroduction to Gitlab
Introduction to Gitlab
Julien Pivotto20.7K views
Demystifying the ForemanDemystifying the Foreman
Demystifying the Foreman
Julien Pivotto2.1K views
DNSSecDNSSec
DNSSec
Julien Pivotto1.9K views
CentOS Config Management SIGCentOS Config Management SIG
CentOS Config Management SIG
Julien Pivotto2.4K views
True Git True Git
True Git
colleenfry1.3K views
Repositories as CodeRepositories as Code
Repositories as Code
Kris Buytaert642 views
We Buy Cheese in a Cheese ShopWe Buy Cheese in a Cheese Shop
We Buy Cheese in a Cheese Shop
Tzu-ping Chung904 views
Python x DjangoPython x Django
Python x Django
Shin Tokiwa1.2K views

Similar to Coworking with git

GitGit
GitRamin Najjarbashi
720 views52 slides
Introduction to GitIntroduction to Git
Introduction to GitRandal Schwartz
3.1K views343 slides
GIT from n00bGIT from n00b
GIT from n00bSupachai Vorrasing
435 views71 slides
Enterprise gitEnterprise git
Enterprise gitPedro Melo
547 views79 slides

Similar to Coworking with git(20)

Gitflow 깃플로우 공유Gitflow 깃플로우 공유
Gitflow 깃플로우 공유
joonjhokil144 views
GitGit
Git
Ramin Najjarbashi720 views
Introduction to GitIntroduction to Git
Introduction to Git
Randal Schwartz3.1K views
GIT from n00bGIT from n00b
GIT from n00b
Supachai Vorrasing435 views
Nightmare on Docker streetNightmare on Docker street
Nightmare on Docker street
Kris Buytaert4K views
Enterprise gitEnterprise git
Enterprise git
Pedro Melo547 views
Pinto+Stratopan+LovePinto+Stratopan+Love
Pinto+Stratopan+Love
Jeffrey Ryan Thalhammer1.1K views
Contributing to YUIContributing to YUI
Contributing to YUI
Dav Glass12.7K views
Git Ninja (bigapp KT)Git Ninja (bigapp KT)
Git Ninja (bigapp KT)
Ashok Kumar179 views
Using Go in DevOpsUsing Go in DevOps
Using Go in DevOps
Eficode897 views
Git censored.keyGit censored.key
Git censored.key
mkramer2922 views
Its not about the toolingIts not about the tooling
Its not about the tooling
Bram Vogelaar100 views
Hacktoberfest 2021Hacktoberfest 2021
Hacktoberfest 2021
SadhanaParameswaran133 views
Don't Let Git Get Your Goat!Don't Let Git Get Your Goat!
Don't Let Git Get Your Goat!
CollabNet1.3K views
Git 101Git 101
Git 101
Kohei Arai41 views

More from Julien Pivotto(20)

The O11y ToolkitThe O11y Toolkit
The O11y Toolkit
Julien Pivotto34 views
What's new in Prometheus?What's new in Prometheus?
What's new in Prometheus?
Julien Pivotto15 views
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana Loki
Julien Pivotto186 views
Why you should revisit mgmtWhy you should revisit mgmt
Why you should revisit mgmt
Julien Pivotto10 views
Prometheus and TLS - an IntroductionPrometheus and TLS - an Introduction
Prometheus and TLS - an Introduction
Julien Pivotto15 views
Powerful graphs in GrafanaPowerful graphs in Grafana
Powerful graphs in Grafana
Julien Pivotto10 views
YAML MagicYAML Magic
YAML Magic
Julien Pivotto4.3K views
HAProxy as Egress ControllerHAProxy as Egress Controller
HAProxy as Egress Controller
Julien Pivotto2.8K views
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with Keycloak
Julien Pivotto10K views
Incident Resolution as CodeIncident Resolution as Code
Incident Resolution as Code
Julien Pivotto818 views
An introduction to AnsibleAn introduction to Ansible
An introduction to Ansible
Julien Pivotto581 views

Recently uploaded(20)

Coworking with git

  • 1. Coworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with gitCoworking with git Collaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for gitCollaborating tips for git Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto LOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, AntwerpLOADays, Antwerp April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015April 11th, 2015
  • 2. whoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoamiwhoami Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto • System administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.euSystem administrator at inuits.eu • Git user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ yearsGit user for 5+ years • DevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believerDevOps believer • Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004Open-source defender since 2004 • @roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie on irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/githubon irc/twitter/github
  • 4. Ops <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 DevOps <3 Dev • Infrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as CodeInfrastructure as Code ▶ SSSSSSSSSSSSSSSSSCM all the things ▶ MMMMMMMMMMMMMMMMMonitoring ▶ CCCCCCCCCCCCCCCCConfiguration ▶ AAAAAAAAAAAAAAAAApplication deployment • Taking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software developmentTaking part of software development ▶ UUUUUUUUUUUUUUUUUnderstanding ▶ MMMMMMMMMMMMMMMMMonitoring ▶ HHHHHHHHHHHHHHHHHigh Availability ▶ ……………………………………………
  • 5. Me and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and gitMe and git • I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago)I first used subversion (10 years ago) • Private forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforgePrivate forges and sourceforge • 5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git5 years later a lot of projects moved to git • The Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot gitThe Puppet community also uses a lot git • GGGGGGGGGGGGGGGGGit/Hg are the de-facto standards in OS projects
  • 6. Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Source: http://git-scm.com/
  • 7. git loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit loggit log • Initiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus TorvaldsInitiated in 2005 by Linus Torvalds • Replacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeperReplacement of closed-source BitKeeper • Created for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel developmentCreated for the Linux Kernel development • Now used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projectsNow used by thousands of projects
  • 8. git is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributedgit is distributed • EEEEEEEEEEEEEEEEEverything can be done in local (except pull&push) • WWWWWWWWWWWWWWWWWork with several remotes • SSSSSSSSSSSSSSSSShare code with anyone • NNNNNNNNNNNNNNNNNo unique central repository • AAAAAAAAAAAAAAAAA lot of workflows possible
  • 9. A teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA teamA team • OOOOOOOOOOOOOOOOOne person • 1111111111111111100 people • CCCCCCCCCCCCCCCCCoders, testers, readers?
  • 10. A repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than codeA repo is more than code • CCCCCCCCCCCCCCCCCode changes • CCCCCCCCCCCCCCCCCommit messages • DDDDDDDDDDDDDDDDDates • BBBBBBBBBBBBBBBBBranches • TTTTTTTTTTTTTTTTTags
  • 11. The Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit MessageThe Commit Message
  • 12. The commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit messageThe commit message • NNNNNNNNNNNNNNNNNever underestimate the commit message • WWWWWWWWWWWWWWWWWill be seen in many occasions: git logs, cherry-picks, git blame, … • AAAAAAAAAAAAAAAAAlways available with the repository, offline
  • 13. FormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormatFormat • OOOOOOOOOOOOOOOOOne short line with a ticket number • <<<<<<<<<<<<<<<<<blank line> • AAAAAAAAAAAAAAAAA more complete description, with context
  • 15. • SSSSSSSSSSSSSSSSStep 1: you pull • SSSSSSSSSSSSSSSSStep 2: you commit • SSSSSSSSSSSSSSSSStep 3: colleague push • SSSSSSSSSSSSSSSSStep 4: you pull • SSSSSSSSSSSSSSSSStep 5: you push
  • 20. d705683 dce1845 7d9d95d 6cea694 dd590b4 ccb3389 85c05ba ccb3389
  • 23. Before: d705683 dce1845 7d9d95d 6cea694 dd590b4 ccb3389 85c05ba ccb3389 After: d705683 dce1845 7d9d95d dd590b4 6fb1d1a
  • 24. rebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasingrebasing • CCCCCCCCCCCCCCCCCleaner project history • LLLLLLLLLLLLLLLLLess commits • """""""""""""""""Single-line" commit history • gggggggggggggggggit pull --rebase
  • 26. Daily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily workDaily work • SSSSSSSSSSSSSSSSStep 1: code on your branch • SSSSSSSSSSSSSSSSStep 2: commit • SSSSSSSSSSSSSSSSStep 3: code again • SSSSSSSSSSSSSSSSStep 4: commit • SSSSSSSSSSSSSSSSStep 5: GOTO Step 1
  • 28. What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have?What do we have? A nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changesA nice step-by-step list of changes A big mess No one would merge that
  • 29. 4dd6437 8ac0fed 3092c78 f55d65e a4c8b39 2ac72a4 48e6f6f 42b3af2 b7d0830 c0cf800 7df0c0a cfe76f4
  • 37. Before: 4dd6437 8ac0fed 3092c78 f55d65e a4c8b39 2ac72a4 48e6f6f 42b3af2 b7d0830 c0cf800 7df0c0a cfe76f4 After: 4dd6437 8ac0fed 3092c78 4fcbe28
  • 38. git rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -igit rebase -i • CCCCCCCCCCCCCCCCChanges the git history • sssssssssssssssssquash, delete, change, reorder commits • gggggggggggggggggit hashes are unique, any change change them
  • 39. The bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro codeThe bro code Never change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits thatNever change commits that are already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushedare already pushed
  • 40. Merge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squashMerge –squash
  • 41. git merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squashgit merge --squash • TTTTTTTTTTTTTTTTThe merge is done but without commits • IIIIIIIIIIIIIIIIIt allows you to commit all in once • EEEEEEEEEEEEEEEEEasily squash a temp branch in a commit
  • 43. d705683 dce1845 7d9d95d 6cea694 935c8e1 bcdb4bf 2aac4c7
  • 45. d705683 dce1845 7d9d95d 6cea694 2679d42 935c8e1 bcdb4bf 2aac4c7
  • 47. git commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amendgit commit --amend • CCCCCCCCCCCCCCCCChange the last commit • AAAAAAAAAAAAAAAAAdd files, change commit message • DDDDDDDDDDDDDDDDDo it before pushing!
  • 50. Use SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH socketsUse SSH sockets $ cat .ssh/config Host githost controlmaster auto controlpath /tmp/ssh-%r@%h:%p ControlPersist 300 • UUUUUUUUUUUUUUUUUse only one SSH connection • DDDDDDDDDDDDDDDDDo not disconnect SSH
  • 51. Find the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commitFind the tag of a commit $ git name-rev --name-only 106cb38dd0bc5ea2d2d0adef0b40 06bd61884e42 remotes/origin/8.5.2~1
  • 52. git autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrectgit autocorrect $ git config help.autocorrect 10 $ git pusk WARNING: You called a Git command named 'pusk', which does not Continuing under the assumption that you meant 'push' in 1.0 seconds automatically...
  • 53. GPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commitsGPG-Sign your commits • gggggggggggggggggit commit -S • SSSSSSSSSSSSSSSSSign PR, merge commits • DDDDDDDDDDDDDDDDDo not sign every commit (then it becomes useless)
  • 54. HomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomeworkHomework • gggggggggggggggggit reflog • gggggggggggggggggit aliases • gggggggggggggggggit bisect • gggggggggggggggggit blame • FFFFFFFFFFFFFFFFFETCH_HEAD
  • 56. conclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusionconclusion • GGGGGGGGGGGGGGGGGit is powerful • AAAAAAAAAAAAAAAAAny commit can be changed • YYYYYYYYYYYYYYYYYou can do anything • AAAAAAAAAAAAAAAAA commit = A logical change • AAAAAAAAAAAAAAAAA clean history brings you easiest blame/bisect • RRRRRRRRRRRRRRRRRemember that git is decentralized
  • 57. Thank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank youThank you Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question?Any question? Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2Git workshop by @teranex 2.30pm in room2
  • 58. ContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContactContact Julien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien PivottoJulien Pivotto julien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eujulien@inuits.eu @roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie@roidelapluie inuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuitsinuits https://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.euhttps://inuits.eu info@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.euinfo@inuits.eu +32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636+32 473 441 636