SlideShare una empresa de Scribd logo
1 de 73
Descargar para leer sin conexión
@lemiorhan#DevoxxPL
Platinum Sponsor:
GITANTI
PATTERNS
How To Mess Up With Git and Love It Again
LEMi ORHAN ERGiN Agile Software Craftsman, iyzico
/lemiorhan
lemiorhanergin.com
@lemiorhan
meetup.scturkey.org
agileturkey.org
slideshare.net/lemiorhan
dev.iyzipay.com
LEMi ORHAN ERGiN
agile software craftsman @ iyzico
agile practice lead at iyzico
developing software since 2001
ex-Sony and ex-eBay employee
consultant, architect, trainer, developer
founder of Software Craftsmanship Turkey
ex community leader of Agile Turkey
got 1 million+ views for his slides
git is powerful
but you have to know using it properly
Are you using git
if all you do is commit-push-pull
use dropbox instead
ANTIPATTERN DANGER
as if it is dropbox ?
learn how git works
no worries, I will cover how git behaves
the way it keeps
FILES & FOLDERS
working copy
staging area
objects database
repository
the way it keeps
REFERENCES
directed acyclic graph
keeping snapshots
traversing graph
branches, tags, heads
git has 2 mechanisms
Source Code
Working Copy
you want to version changes
Source Code
Working Copy
$ git init
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
initializing repo
Source Code
Working Copy
$ git init --bare
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
initializing bare repo
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git add .
preparing commits
folder
folder
folder
file
file
file
$ git add .
preparing commits
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git add .
preparing commits
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git commit -m “initial commit”
commi!ing
$ git commit -m “initial commit”
commi!ing
folder
folder
folder
file
file
file
commit
branch
HEAD
For more details, refer to book
Git Internals by Scott Chacon
folder
folder
folder
file
file
file
commit
$ git commit -m “second commit”
commi!ing
folder
commit
branch
HEAD
folder
file
folder
For more details, refer to book
Git Internals by Scott Chacon
folder
folder
folder
file
file
file
commit
$ git commit -m “third commit”
commi!ing
folder
commit
folder
file
folder
folder
commit
branch
HEAD
file
For more details, refer to book
Git Internals by Scott Chacon
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git commit -m “initial commit”
commi!ing
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git remote add origin http://upstream.repo
$ git push -u origin master pushing to remote
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
new changes from others are pushed
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git fetch
fetching changes
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git merge FETCHED_HEAD
updating working copy
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git pull
git fetch + git merge
ge!ing changes to source code
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
want to update last commit
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git reset --soft $ git commit --amend/ so" reseting
cannot be reached
Only the cache for
the commit you reseted
is removed from staging area
for your current branch
folder
folder
folder
file
file
file
commit
folder
commit
folder
file
folder
folder
commit
branch
HEAD
file
For more details, refer to book
Git Internals by Scott Chacon
$ git reset --soft $ git commit --amend/ so" reseting
folder
folder
folder
file
file
file
commit
folder
commit
folder
file
folder
folder
commit
branch
HEAD
file
For more details, refer to book
Git Internals by Scott Chacon
$ git reset --soft $ git commit --amend/ so" reseting
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
want to squash or change last commits
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git reset --mixed
mixed reseting
cannot be reached
entries for commits, files
and folders are removed
from staging area
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
want to get rid of last commits
Object Database
.git Folder / Object Database
Cache
Staging Area / The Index
Remote
Upstream Repo / Remote Repo
Server
Source Code
Working Copy
$ git reset --hard
hard reseting
cannot be reached
removed from staging area
removed from working copy
are you brave enough to
jump to any commit ?
jump to a branch
create a branch from a commit
create a branch from a tag
ANTIPATTERN DANGER
$ git checkout feature/PA-121
$ git checkout -b fix/missing-sign-parameter 2449be8
$ git checkout -b hotfix/v1.1 tags/v1
are you sure?
are you brave enough to
jump to any commit ?
do you have
loooooong living
topic branches ?
ANTIPATTERN DANGER
do you have
loooooong living
topic branches ?
welcome to
merge hell
before merging
do you validate commits
back to source ?
ANTIPATTERN DANGER
code review, continuous integration, automated testing…
before merging
do you validate commits
back to source ? areyou
sure?
merge and unmerge
do you o!en want to
just before releases ?
ANTIPATTERN DANGER
merge and unmerge
do you o!en want to
just before releases ?
master
HEAD
TAG/v13
version 14
$ git cherry-pick Every-Single-Commit-We-Want-To-Deploy
the commit graph ?
do you fully understand
ANTIPATTERN DANGER
the commit graph ?
do you fully understand
topic and shared branches, tracking branches, tags, HEADs, merge commits, reverted commits…
Cure?
Commit Early, Commit O"en
Perfect Later, Publish Once
STEP 0
split your big feature into
mini shippable tasks
master
HEAD
TOPIC
ORIGIN/master
refactorings
tasks, like rest endpoints
testable, deployable
each task will have a
branch, not a feature
STEP 1
commit early
commit o!en
no need to compile
no need for CI
it’s only for versioning
do not push
master
HEAD
TOPIC
ORIGIN/master
always pull with rebase
$ git pull --rebase origin master
to get forced pushes securely
to rebase your commits
master
HEAD
TOPIC
STEP 2
ORIGIN/master
always pull with rebase
$ git pull --rebase origin master
to get forced pushes securely
to rebase your commits
master
HEAD
TOPIC
STEP 2
ORIGIN/master
always pull with rebase
$ git pull --rebase origin master
to get forced pushes securely
to rebase your commits
master
HEAD
TOPIC
STEP 2
ORIGIN/master
if you branch is pushed already
$ git push -f
always pull with rebase
$ git pull --rebase origin master
to get forced pushes securely
to rebase your commitsmaster
HEAD
TOPIC
STEP 2
ORIGIN/master
if you branch is pushed already
$ git push -f
Sync source branch a!erwards
$ git fetch origin master:master
perfect later
make it single commit
$ git reset HEAD~3
or
$ git rebase -i HEAD~3
HEAD
TOPIC
STEP 3
ORIGIN/master
tests are passing
app is working
code is reviewed (*)
master
$ git reset HEAD~3 (then commit)
or
$ git rebase -i HEAD~3
HEAD
TOPIC
STEP 3
ORIGIN/master
perfect later
make it single commit
tests are passing
app is working
code is reviewed (*)
master
Use feature flags/toggles
HEAD
TOPIC
STEP 4
ORIGIN/master
if feature should be disabled
merge back to source
$ git checkout master
$ git merge topic
master
Use feature flags/toggles
master
HEAD
TOPIC
STEP 4
ORIGIN/master
if feature should be disabled
merge back to source
$ git checkout master
$ git merge topic
Continuous Integration
validates master branch
continuouslymaster
HEAD
TOPIC
ORIGIN/master
Pull requests can be
used to review code
and to validate before
merging back to master
Scrum tasks are
mapped to commits,
not stories
Github Flow can be
used to govern overall
TAMING
THE POWER OF GIT
make git the king again
Feature flags should be
used whenever possible
Commit early & o"en
perfect later, publish
once philosophy
Deliver frequently
be prepared to send
every single commit
Deleting branches a"er
merge will make your
commit graph readable
Any Other Cures?
use terminal
GUIs are prison balls of developers
it’s ok to use GUIs while checking diffs,
resolving conflicts and viewing commit graph
do not lose
take extra care while using hard reset
$ git reset --merge HEAD~
Use stash $ git stash save “updates local settings to keep db safe”
$ git reset --hard HEAD~
$ git stash apply stash@{0}
Create a new branch $ git checkout -b feature/PA-121
$ git add settings.xml
$ git commit -m “adds new settings config”
Use hard reset
with merge
and commit into it
uncommited changes
TOPIC
HEAD
MASTER
long living branches with care
handle
Squash all commits in your topic branch and 

make them available in working copy
$ git merge --squash fix
Squash commit -- not updating HEAD
Automatic merge went well; stopped before committing as requested
$ git add .
$ git commit -m “adds a feature”
$ git branch -D topic
long living branches with care
handle
TOPIC
HEAD
MASTER
$ git merge --squash fix
Squash commit -- not updating HEAD
Automatic merge went well; stopped before committing as requested
$ git add .
$ git commit -m “adds a feature”
$ git branch -D topic
Squash all commits in your topic branch and 

make them available in working copy
stop adding
prevent commits from being big ball of muds
every change
stop adding
prevent commits from being big ball of muds
every change
local change sets at JetBrains IDEs
stop adding every change
partial add
messages
are
read!
# WHAT
# <issue id> (this commit will...) <subject>
# WHY and HOW
# Explain why this change is being made
# RELATED
# Provide links or keys to any relevant issues or other resources
# REMEMBER
# use lower case in the subject line
# start with a verb in imperative tone in the subject line
# do not end the subject line with a period
# separate subject from body with a blank line
# use the body to explain what and why vs. how
# can use multiple lines with "-" for bullet points in body
$ git config --global commit.template ~/.git-commit-template.txt
$ git config --global commit.cleanup strip
.git-commit-template.txt
use git commit
templates to
create be"er
commit messages
comtmi
messages
are
read!
use git commit
templates to
create be"er
commit messages
comtmi
RECAP
what was really
happened at that time?
LET’S
master
TAG/v1.1
login
HEAD
DETACHED HEAD STATE
$ git checkout cecd95914
Note: checking out 'cecd95914'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
master
TAG/v1.1
login
HEAD
DETACHED HEAD STATE
$ git rebase (and conflicts happen)
$ git checkout HEAD~2
$ git checkout 43e3ab01
$ git checkout tags/v1.1
WHEN IT HAPPENS
master
TAG/v1.1
login
HEAD
poor little developer...
master
TAG/v1.1
login
HEAD
$ git checkout master
master
TAG/v1.1
login
HEAD
$ git reflog
aa67e3a2c HEAD@{0}: rebase finished: returning to refs/heads/fix/java-sql-Date-violates-LSR
aa67e3a2c HEAD@{1}: rebase: fixes UnsupportedOperationException while calling toIstant() method of java.sql.Date
a45f3c4e5 HEAD@{2}: rebase: checkout develop
630ddad6e HEAD@{3}: checkout: moving from develop to fix/java-sql-Date-violates-LSR
b26cf7a1a HEAD@{4}: rebase: checkout develop
630ddad6e HEAD@{5}: checkout: moving from develop to fix/java-sql-Date-violates-LSR
b26cf7a1a HEAD@{6}: pull: Fast-forward
8b59f8f50 HEAD@{7}: checkout: moving from fix/java-sql-Date-violates-LSR to develop
$ git reflog
630ddad6e
the one we are
searching for
master
TAG/v1.1
login
HEAD
aa67e3a2c HEAD@{0}: rebase finished: returning to refs/heads/fix/java-sql-Date-violates-LSR
aa67e3a2c HEAD@{1}: rebase: fixes UnsupportedOperationException while calling toIstant() method of java.sql.Date
a45f3c4e5 HEAD@{2}: rebase: checkout develop
630ddad6e HEAD@{3}: checkout: moving from develop to fix/java-sql-Date-violates-LSR
b26cf7a1a HEAD@{4}: rebase: checkout develop
630ddad6e HEAD@{5}: checkout: moving from develop to fix/java-sql-Date-violates-LSR
b26cf7a1a HEAD@{6}: pull: Fast-forward
8b59f8f50 HEAD@{7}: checkout: moving from fix/java-sql-Date-violates-LSR to develop
master
typofix
TAG/v1.1
login
HEAD
$ git branch typofix 630ddad6e
master
typofix
TAG/v1.1
login
HEAD
$ git branch typofix 630ddad6e
KEEP CALM, NOTHING WILL BE LOST
LEMi ORHAN ERGiN
agile software craftsman @ iyzico
/lemiorhan
lemiorhanergin.com
@lemiorhan
DO NOT FORGET
VIA MY DEVOXX MOBILE APP
TO GIVE FEEDBACK TO LEMI

Más contenido relacionado

La actualidad más candente

Tracking huge files with Git LFS - LinuxCon 2016
Tracking huge files with Git LFS - LinuxCon 2016Tracking huge files with Git LFS - LinuxCon 2016
Tracking huge files with Git LFS - LinuxCon 2016Tim Pettersen
 
Code reviews vs Pull requests
Code reviews vs Pull requestsCode reviews vs Pull requests
Code reviews vs Pull requestsTim Pettersen
 
Adding Source Control to Your Life
Adding Source Control to Your LifeAdding Source Control to Your Life
Adding Source Control to Your LifeMark Kelnar
 
DO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSDO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSSeongJae Park
 
What’s New in Rails 5.0?
What’s New in Rails 5.0?What’s New in Rails 5.0?
What’s New in Rails 5.0?Unboxed
 
Cutting Code Quickly - LLEWELLYN FALCO
Cutting Code Quickly - LLEWELLYN FALCOCutting Code Quickly - LLEWELLYN FALCO
Cutting Code Quickly - LLEWELLYN FALCOagilemaine
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlBecky Todd
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainKen Collins
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowJosé Paumard
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsLee Hanxue
 
ZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everythingZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everythingGianluca Arbezzano
 
Jenkins User Conference 2013 Palo Alto: Keynote
Jenkins User Conference 2013 Palo Alto: KeynoteJenkins User Conference 2013 Palo Alto: Keynote
Jenkins User Conference 2013 Palo Alto: KeynoteKohsuke Kawaguchi
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon MelbournePaal Ringstad
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution beginSeongJae Park
 

La actualidad más candente (20)

Tracking huge files with Git LFS - LinuxCon 2016
Tracking huge files with Git LFS - LinuxCon 2016Tracking huge files with Git LFS - LinuxCon 2016
Tracking huge files with Git LFS - LinuxCon 2016
 
Code reviews vs Pull requests
Code reviews vs Pull requestsCode reviews vs Pull requests
Code reviews vs Pull requests
 
Git Real
Git RealGit Real
Git Real
 
Git internals
Git internalsGit internals
Git internals
 
Adding Source Control to Your Life
Adding Source Control to Your LifeAdding Source Control to Your Life
Adding Source Control to Your Life
 
DO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCSDO YOU WANT TO USE A VCS
DO YOU WANT TO USE A VCS
 
Geek git
Geek gitGeek git
Geek git
 
What’s New in Rails 5.0?
What’s New in Rails 5.0?What’s New in Rails 5.0?
What’s New in Rails 5.0?
 
Cutting Code Quickly - LLEWELLYN FALCO
Cutting Code Quickly - LLEWELLYN FALCOCutting Code Quickly - LLEWELLYN FALCO
Cutting Code Quickly - LLEWELLYN FALCO
 
Cutting code quickly
Cutting code quicklyCutting code quickly
Cutting code quickly
 
Git the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version controlGit the Docs: A fun, hands-on introduction to version control
Git the Docs: A fun, hands-on introduction to version control
 
Inside GitHub with Chris Wanstrath
Inside GitHub with Chris WanstrathInside GitHub with Chris Wanstrath
Inside GitHub with Chris Wanstrath
 
Free The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own DomainFree The Enterprise With Ruby & Master Your Own Domain
Free The Enterprise With Ruby & Master Your Own Domain
 
Asynchronous Systems with Fn Flow
Asynchronous Systems with Fn FlowAsynchronous Systems with Fn Flow
Asynchronous Systems with Fn Flow
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Vagrant - PugMI
Vagrant - PugMIVagrant - PugMI
Vagrant - PugMI
 
ZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everythingZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everything
 
Jenkins User Conference 2013 Palo Alto: Keynote
Jenkins User Conference 2013 Palo Alto: KeynoteJenkins User Conference 2013 Palo Alto: Keynote
Jenkins User Conference 2013 Palo Alto: Keynote
 
Github - Le Wagon Melbourne
Github - Le Wagon MelbourneGithub - Le Wagon Melbourne
Github - Le Wagon Melbourne
 
Let the contribution begin
Let the contribution beginLet the contribution begin
Let the contribution begin
 

Similar a Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017

A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with GitDmitry Sheiko
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get GitSusan Tan
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for GitJan Krag
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control SystemVictor Wong
 
Introduction of Git
Introduction of GitIntroduction of Git
Introduction of GitWayne Chen
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With GitNick Quaranto
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitRick Umali
 
Getting some Git
Getting some GitGetting some Git
Getting some GitBADR
 
Effective Git with Eclipse
Effective Git with EclipseEffective Git with Eclipse
Effective Git with EclipseChris Aniszczyk
 
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remotoRodrigo Branas
 
Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciAtlassian
 

Similar a Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017 (20)

A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
How to Really Get Git
How to Really Get GitHow to Really Get Git
How to Really Get Git
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for Git
 
Git Distributed Version Control System
Git   Distributed Version Control SystemGit   Distributed Version Control System
Git Distributed Version Control System
 
Introduction of Git
Introduction of GitIntroduction of Git
Introduction of Git
 
Git Started With Git
Git Started With GitGit Started With Git
Git Started With Git
 
Gittalk
GittalkGittalk
Gittalk
 
Jedi Mind Tricks in Git
Jedi Mind Tricks in GitJedi Mind Tricks in Git
Jedi Mind Tricks in Git
 
Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git Master
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Getting some Git
Getting some GitGetting some Git
Getting some Git
 
Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)Introduction to Git (Greg Lonnon)
Introduction to Git (Greg Lonnon)
 
Effective Git with Eclipse
Effective Git with EclipseEffective Git with Eclipse
Effective Git with Eclipse
 
#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto#5 - Git - Contribuindo com um repositório remoto
#5 - Git - Contribuindo com um repositório remoto
 
Becoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola PaolucciBecoming a Git Master - Nicola Paolucci
Becoming a Git Master - Nicola Paolucci
 
Git
GitGit
Git
 
Git
GitGit
Git
 
Git presentation
Git presentationGit presentation
Git presentation
 
Git
GitGit
Git
 

Más de Lemi Orhan Ergin

Clean Software Design: The Practices to Make The Design Simple
Clean Software Design: The Practices to Make The Design SimpleClean Software Design: The Practices to Make The Design Simple
Clean Software Design: The Practices to Make The Design SimpleLemi Orhan Ergin
 
Unwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingUnwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingLemi Orhan Ergin
 
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 201810 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018Lemi Orhan Ergin
 
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...Lemi Orhan Ergin
 
Irresponsible Disclosure: Short Handbook of an Ethical Developer
Irresponsible Disclosure: Short Handbook of an Ethical DeveloperIrresponsible Disclosure: Short Handbook of an Ethical Developer
Irresponsible Disclosure: Short Handbook of an Ethical DeveloperLemi Orhan Ergin
 
Scrum Events and Artifacts in Action
Scrum Events and Artifacts in ActionScrum Events and Artifacts in Action
Scrum Events and Artifacts in ActionLemi Orhan Ergin
 
DevOps & Technical Agility: From Theory to Practice
DevOps & Technical Agility: From Theory to PracticeDevOps & Technical Agility: From Theory to Practice
DevOps & Technical Agility: From Theory to PracticeLemi Orhan Ergin
 
Fighting with Waste Driven Development - XP Days Ukraine 2017
Fighting with Waste Driven Development - XP Days Ukraine 2017Fighting with Waste Driven Development - XP Days Ukraine 2017
Fighting with Waste Driven Development - XP Days Ukraine 2017Lemi Orhan Ergin
 
Waste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia MeetupWaste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia MeetupLemi Orhan Ergin
 
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...Lemi Orhan Ergin
 
Clean Software Design - DevNot Summit Istanbul 2017
Clean Software Design - DevNot Summit Istanbul 2017Clean Software Design - DevNot Summit Istanbul 2017
Clean Software Design - DevNot Summit Istanbul 2017Lemi Orhan Ergin
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Lemi Orhan Ergin
 
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...Lemi Orhan Ergin
 
Happy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of DevelopersHappy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of DevelopersLemi Orhan Ergin
 
Git - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilGit - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilLemi Orhan Ergin
 
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationCode Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationLemi Orhan Ergin
 
Lost in Motivation in an Agile World
Lost in Motivation in an Agile WorldLost in Motivation in an Agile World
Lost in Motivation in an Agile WorldLemi Orhan Ergin
 
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)Lemi Orhan Ergin
 
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)Lemi Orhan Ergin
 
Trespassing The Forgotten and Abandoned: Ethics in Software Development
Trespassing The Forgotten and Abandoned:  Ethics in Software DevelopmentTrespassing The Forgotten and Abandoned:  Ethics in Software Development
Trespassing The Forgotten and Abandoned: Ethics in Software DevelopmentLemi Orhan Ergin
 

Más de Lemi Orhan Ergin (20)

Clean Software Design: The Practices to Make The Design Simple
Clean Software Design: The Practices to Make The Design SimpleClean Software Design: The Practices to Make The Design Simple
Clean Software Design: The Practices to Make The Design Simple
 
Unwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingUnwritten Manual for Pair Programming
Unwritten Manual for Pair Programming
 
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 201810 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018
 
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
 
Irresponsible Disclosure: Short Handbook of an Ethical Developer
Irresponsible Disclosure: Short Handbook of an Ethical DeveloperIrresponsible Disclosure: Short Handbook of an Ethical Developer
Irresponsible Disclosure: Short Handbook of an Ethical Developer
 
Scrum Events and Artifacts in Action
Scrum Events and Artifacts in ActionScrum Events and Artifacts in Action
Scrum Events and Artifacts in Action
 
DevOps & Technical Agility: From Theory to Practice
DevOps & Technical Agility: From Theory to PracticeDevOps & Technical Agility: From Theory to Practice
DevOps & Technical Agility: From Theory to Practice
 
Fighting with Waste Driven Development - XP Days Ukraine 2017
Fighting with Waste Driven Development - XP Days Ukraine 2017Fighting with Waste Driven Development - XP Days Ukraine 2017
Fighting with Waste Driven Development - XP Days Ukraine 2017
 
Waste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia MeetupWaste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia Meetup
 
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
 
Clean Software Design - DevNot Summit Istanbul 2017
Clean Software Design - DevNot Summit Istanbul 2017Clean Software Design - DevNot Summit Istanbul 2017
Clean Software Design - DevNot Summit Istanbul 2017
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016
 
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
 
Happy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of DevelopersHappy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
 
Git - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilGit - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi Değil
 
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationCode Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
 
Lost in Motivation in an Agile World
Lost in Motivation in an Agile WorldLost in Motivation in an Agile World
Lost in Motivation in an Agile World
 
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
TDD - Inevitable Challenge for Software Developers (phpkonf15 keynote)
 
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
Unleashed Power Behind The Myths: Pair Programming (CraftSummit15)
 
Trespassing The Forgotten and Abandoned: Ethics in Software Development
Trespassing The Forgotten and Abandoned:  Ethics in Software DevelopmentTrespassing The Forgotten and Abandoned:  Ethics in Software Development
Trespassing The Forgotten and Abandoned: Ethics in Software Development
 

Último

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Último (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017

  • 1. @lemiorhan#DevoxxPL Platinum Sponsor: GITANTI PATTERNS How To Mess Up With Git and Love It Again LEMi ORHAN ERGiN Agile Software Craftsman, iyzico
  • 2. /lemiorhan lemiorhanergin.com @lemiorhan meetup.scturkey.org agileturkey.org slideshare.net/lemiorhan dev.iyzipay.com LEMi ORHAN ERGiN agile software craftsman @ iyzico agile practice lead at iyzico developing software since 2001 ex-Sony and ex-eBay employee consultant, architect, trainer, developer founder of Software Craftsmanship Turkey ex community leader of Agile Turkey got 1 million+ views for his slides
  • 3. git is powerful but you have to know using it properly
  • 4. Are you using git if all you do is commit-push-pull use dropbox instead ANTIPATTERN DANGER as if it is dropbox ?
  • 5. learn how git works no worries, I will cover how git behaves
  • 6. the way it keeps FILES & FOLDERS working copy staging area objects database repository the way it keeps REFERENCES directed acyclic graph keeping snapshots traversing graph branches, tags, heads git has 2 mechanisms
  • 7. Source Code Working Copy you want to version changes
  • 8. Source Code Working Copy $ git init Object Database .git Folder / Object Database Cache Staging Area / The Index initializing repo
  • 9. Source Code Working Copy $ git init --bare Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server initializing bare repo
  • 10. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git add . preparing commits
  • 12. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git add . preparing commits
  • 13. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git commit -m “initial commit” commi!ing
  • 14. $ git commit -m “initial commit” commi!ing folder folder folder file file file commit branch HEAD For more details, refer to book Git Internals by Scott Chacon
  • 15. folder folder folder file file file commit $ git commit -m “second commit” commi!ing folder commit branch HEAD folder file folder For more details, refer to book Git Internals by Scott Chacon
  • 16. folder folder folder file file file commit $ git commit -m “third commit” commi!ing folder commit folder file folder folder commit branch HEAD file For more details, refer to book Git Internals by Scott Chacon
  • 17. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git commit -m “initial commit” commi!ing
  • 18. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git remote add origin http://upstream.repo $ git push -u origin master pushing to remote
  • 19. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy new changes from others are pushed
  • 20. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git fetch fetching changes
  • 21. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git merge FETCHED_HEAD updating working copy
  • 22. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git pull git fetch + git merge ge!ing changes to source code
  • 23. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy want to update last commit
  • 24. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git reset --soft $ git commit --amend/ so" reseting cannot be reached Only the cache for the commit you reseted is removed from staging area for your current branch
  • 25. folder folder folder file file file commit folder commit folder file folder folder commit branch HEAD file For more details, refer to book Git Internals by Scott Chacon $ git reset --soft $ git commit --amend/ so" reseting
  • 26. folder folder folder file file file commit folder commit folder file folder folder commit branch HEAD file For more details, refer to book Git Internals by Scott Chacon $ git reset --soft $ git commit --amend/ so" reseting
  • 27. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy want to squash or change last commits
  • 28. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git reset --mixed mixed reseting cannot be reached entries for commits, files and folders are removed from staging area
  • 29. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy want to get rid of last commits
  • 30. Object Database .git Folder / Object Database Cache Staging Area / The Index Remote Upstream Repo / Remote Repo Server Source Code Working Copy $ git reset --hard hard reseting cannot be reached removed from staging area removed from working copy
  • 31. are you brave enough to jump to any commit ? jump to a branch create a branch from a commit create a branch from a tag ANTIPATTERN DANGER $ git checkout feature/PA-121 $ git checkout -b fix/missing-sign-parameter 2449be8 $ git checkout -b hotfix/v1.1 tags/v1
  • 32. are you sure? are you brave enough to jump to any commit ?
  • 33. do you have loooooong living topic branches ? ANTIPATTERN DANGER
  • 34. do you have loooooong living topic branches ? welcome to merge hell
  • 35. before merging do you validate commits back to source ? ANTIPATTERN DANGER code review, continuous integration, automated testing…
  • 36. before merging do you validate commits back to source ? areyou sure?
  • 37. merge and unmerge do you o!en want to just before releases ? ANTIPATTERN DANGER
  • 38. merge and unmerge do you o!en want to just before releases ? master HEAD TAG/v13 version 14 $ git cherry-pick Every-Single-Commit-We-Want-To-Deploy
  • 39. the commit graph ? do you fully understand ANTIPATTERN DANGER
  • 40. the commit graph ? do you fully understand topic and shared branches, tracking branches, tags, HEADs, merge commits, reverted commits…
  • 41. Cure?
  • 42. Commit Early, Commit O"en Perfect Later, Publish Once
  • 43. STEP 0 split your big feature into mini shippable tasks master HEAD TOPIC ORIGIN/master refactorings tasks, like rest endpoints testable, deployable each task will have a branch, not a feature
  • 44. STEP 1 commit early commit o!en no need to compile no need for CI it’s only for versioning do not push master HEAD TOPIC ORIGIN/master
  • 45. always pull with rebase $ git pull --rebase origin master to get forced pushes securely to rebase your commits master HEAD TOPIC STEP 2 ORIGIN/master
  • 46. always pull with rebase $ git pull --rebase origin master to get forced pushes securely to rebase your commits master HEAD TOPIC STEP 2 ORIGIN/master
  • 47. always pull with rebase $ git pull --rebase origin master to get forced pushes securely to rebase your commits master HEAD TOPIC STEP 2 ORIGIN/master if you branch is pushed already $ git push -f
  • 48. always pull with rebase $ git pull --rebase origin master to get forced pushes securely to rebase your commitsmaster HEAD TOPIC STEP 2 ORIGIN/master if you branch is pushed already $ git push -f Sync source branch a!erwards $ git fetch origin master:master
  • 49. perfect later make it single commit $ git reset HEAD~3 or $ git rebase -i HEAD~3 HEAD TOPIC STEP 3 ORIGIN/master tests are passing app is working code is reviewed (*) master
  • 50. $ git reset HEAD~3 (then commit) or $ git rebase -i HEAD~3 HEAD TOPIC STEP 3 ORIGIN/master perfect later make it single commit tests are passing app is working code is reviewed (*) master
  • 51. Use feature flags/toggles HEAD TOPIC STEP 4 ORIGIN/master if feature should be disabled merge back to source $ git checkout master $ git merge topic master
  • 52. Use feature flags/toggles master HEAD TOPIC STEP 4 ORIGIN/master if feature should be disabled merge back to source $ git checkout master $ git merge topic
  • 53. Continuous Integration validates master branch continuouslymaster HEAD TOPIC ORIGIN/master Pull requests can be used to review code and to validate before merging back to master Scrum tasks are mapped to commits, not stories Github Flow can be used to govern overall TAMING THE POWER OF GIT make git the king again Feature flags should be used whenever possible Commit early & o"en perfect later, publish once philosophy Deliver frequently be prepared to send every single commit Deleting branches a"er merge will make your commit graph readable
  • 55. use terminal GUIs are prison balls of developers it’s ok to use GUIs while checking diffs, resolving conflicts and viewing commit graph
  • 56. do not lose take extra care while using hard reset $ git reset --merge HEAD~ Use stash $ git stash save “updates local settings to keep db safe” $ git reset --hard HEAD~ $ git stash apply stash@{0} Create a new branch $ git checkout -b feature/PA-121 $ git add settings.xml $ git commit -m “adds new settings config” Use hard reset with merge and commit into it uncommited changes
  • 57. TOPIC HEAD MASTER long living branches with care handle Squash all commits in your topic branch and 
 make them available in working copy $ git merge --squash fix Squash commit -- not updating HEAD Automatic merge went well; stopped before committing as requested $ git add . $ git commit -m “adds a feature” $ git branch -D topic
  • 58. long living branches with care handle TOPIC HEAD MASTER $ git merge --squash fix Squash commit -- not updating HEAD Automatic merge went well; stopped before committing as requested $ git add . $ git commit -m “adds a feature” $ git branch -D topic Squash all commits in your topic branch and 
 make them available in working copy
  • 59. stop adding prevent commits from being big ball of muds every change
  • 60. stop adding prevent commits from being big ball of muds every change local change sets at JetBrains IDEs
  • 61. stop adding every change partial add
  • 62. messages are read! # WHAT # <issue id> (this commit will...) <subject> # WHY and HOW # Explain why this change is being made # RELATED # Provide links or keys to any relevant issues or other resources # REMEMBER # use lower case in the subject line # start with a verb in imperative tone in the subject line # do not end the subject line with a period # separate subject from body with a blank line # use the body to explain what and why vs. how # can use multiple lines with "-" for bullet points in body $ git config --global commit.template ~/.git-commit-template.txt $ git config --global commit.cleanup strip .git-commit-template.txt use git commit templates to create be"er commit messages comtmi
  • 63. messages are read! use git commit templates to create be"er commit messages comtmi
  • 64. RECAP what was really happened at that time? LET’S
  • 65. master TAG/v1.1 login HEAD DETACHED HEAD STATE $ git checkout cecd95914 Note: checking out 'cecd95914'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.
  • 66. master TAG/v1.1 login HEAD DETACHED HEAD STATE $ git rebase (and conflicts happen) $ git checkout HEAD~2 $ git checkout 43e3ab01 $ git checkout tags/v1.1 WHEN IT HAPPENS
  • 69. master TAG/v1.1 login HEAD $ git reflog aa67e3a2c HEAD@{0}: rebase finished: returning to refs/heads/fix/java-sql-Date-violates-LSR aa67e3a2c HEAD@{1}: rebase: fixes UnsupportedOperationException while calling toIstant() method of java.sql.Date a45f3c4e5 HEAD@{2}: rebase: checkout develop 630ddad6e HEAD@{3}: checkout: moving from develop to fix/java-sql-Date-violates-LSR b26cf7a1a HEAD@{4}: rebase: checkout develop 630ddad6e HEAD@{5}: checkout: moving from develop to fix/java-sql-Date-violates-LSR b26cf7a1a HEAD@{6}: pull: Fast-forward 8b59f8f50 HEAD@{7}: checkout: moving from fix/java-sql-Date-violates-LSR to develop
  • 70. $ git reflog 630ddad6e the one we are searching for master TAG/v1.1 login HEAD aa67e3a2c HEAD@{0}: rebase finished: returning to refs/heads/fix/java-sql-Date-violates-LSR aa67e3a2c HEAD@{1}: rebase: fixes UnsupportedOperationException while calling toIstant() method of java.sql.Date a45f3c4e5 HEAD@{2}: rebase: checkout develop 630ddad6e HEAD@{3}: checkout: moving from develop to fix/java-sql-Date-violates-LSR b26cf7a1a HEAD@{4}: rebase: checkout develop 630ddad6e HEAD@{5}: checkout: moving from develop to fix/java-sql-Date-violates-LSR b26cf7a1a HEAD@{6}: pull: Fast-forward 8b59f8f50 HEAD@{7}: checkout: moving from fix/java-sql-Date-violates-LSR to develop
  • 72. master typofix TAG/v1.1 login HEAD $ git branch typofix 630ddad6e KEEP CALM, NOTHING WILL BE LOST
  • 73. LEMi ORHAN ERGiN agile software craftsman @ iyzico /lemiorhan lemiorhanergin.com @lemiorhan DO NOT FORGET VIA MY DEVOXX MOBILE APP TO GIVE FEEDBACK TO LEMI