SlideShare a Scribd company logo
Andrzej Grzesik
Konrad Malawski
LunarLogicPolska
Effective Git
Effective Git
Ask them right away!
a distributed

                open source

                              version control system
is also
      fast
         reliable
             powerful
                  popular
Effective Git
•    it is too new
•    not tested
•    does not provide backups (sic!)
•    does not like windows
•    does not support ...
•    it's not subversion
Git is "simple" but hard.
Subversion is "easy", but eventually complex.




                                                          Thomas Nicolaisen
    (http://blog.tfnico.com/2011/11/some-thoughts-on-git-vs-complexity.html)
git config --global user.name Sheldon Cooper
git config --global user.email bazinga@bigbang.com
git config --global color.ui true
Effective Git
Effective Git
•    cherry-pick
•    rebase (interactive)
•    interactive add
•    submodules
•    git svn
•    git sh
Effective Git
Effective Git
Effective Git
Effective Git
# initialize a submodule
git submodule add git://llp.pl/common.git common

# initial pull of it's contents
git submodule init

# pull pointed to commit (and overwrite your changes)
git submodule update
Effective Git
cd common

git pull

cd ..

# Warning! Add the dir without trailing "/”
git add common

git commit -m "Latest common submodule commit"
Effective Git
Effective Git
... or "Why merge isn't enough?"
Effective Git
Effective Git
Effective Git
Effective Git
Effective Git
Effective Git
Effective Git
Effective Git
https://github.com/ktoso/maven-git-commit-id-plugin
Keeping commit info in UI of the running app,
results in better (or less!) bug reports :-)
Or expose full details, for developers only

@Inject
GitRepositoryState repoState;

@GET
@Path("/git")
public GitRepositoryState getRepoState()
{
  return repoState;
}
                                           { "branch" : "testing-maven-git-plugin",
                                           "commitTime" : "06.01.1970 @ 16:16:26 CET",
                                           "commitId" :
                                           "787e39f61f99110e74deed68ab9093088d64b969",
                                           "commitIdAbbrev" : "787e39f", "commitUserName" :
                                           "Konrad Malawski", "commitUserEmail" :
                                           "konrad.malawski@java.pl", "commitMessageFull" :
                                           "releasing my fun plugin :-) + fixed some typos +
                                           cleaned up directory structure + added license etc",
                                           "commitMessageShort" : "releasing my fun plugin :-)",
                                           "buildTime" : "06.01.1970 @ 16:17:53 CET",
                                           "buildUserName" : "Konrad Malawski",
                                           "buildUserEmail" : "konrad.malawski@java.pl" }
Effective Git
De facto standard of viewing git-based repositories

Just point it to the repo

Works through Apache and CGI
simple, read/write permissions
per-repository

ssh-key based authentication

but it's trivial to expose config file via f.ex. Grails frontend
online code review
(like ReviewBoard, but better ;-))

also hosts git repositories
      review commits before they enter a branch
    with some help
        by the power of Jenkins, 
            allows to have pre-tested commits
Effective Git
Effective Git
Git immersion:
http://library.edgecase.com/git_immersion/index.html
On branching with Git
http://nvie.com/posts/a-successful-git-branching-model/
Pro Git book (creative commons)
www.progit.org
Git-scm.com
Git.wiki.kernel.org

More Related Content

PDF
Getting started with git svn
PPTX
Working in Team using Git in Unity
PPTX
From svn to git
PPTX
01 - Git vs SVN
PDF
Git submodule
PDF
Git vs Subversion: ¿Cuando elegir uno u otro?
ODP
Git vs svn
PDF
SVN 2 Git
Getting started with git svn
Working in Team using Git in Unity
From svn to git
01 - Git vs SVN
Git submodule
Git vs Subversion: ¿Cuando elegir uno u otro?
Git vs svn
SVN 2 Git

What's hot (20)

PDF
What the Git? - WordCamp Atlanta
PDF
Git Workflow With Gitflow
PPTX
Svn vs mercurial vs github
PDF
Gitlab ci e kubernetes, build test and deploy your projects like a pro
PDF
Training: Day Two - Eclipse, Git, Maven
PDF
CI with Gitlab & Docker
PDF
Subversion to Git Migration
PDF
Git - Intro to the Basics of DVCS
PDF
Fabric8 CI/CD
PDF
From SVN to Git
PDF
Git & gitflow
PPTX
Docker e git lab
PDF
Introducing Koki Short
PDF
FOSDEM 2017: GitLab CI
PDF
Kompose
PDF
Subversion to Git Migration
PPTX
PDF
Kubernetes Basic Operation
PDF
Microservices on Kubernetes - The simple way
PDF
通过 Ktor 迅速打造以 Kotlin 为核心的后端服务应用
What the Git? - WordCamp Atlanta
Git Workflow With Gitflow
Svn vs mercurial vs github
Gitlab ci e kubernetes, build test and deploy your projects like a pro
Training: Day Two - Eclipse, Git, Maven
CI with Gitlab & Docker
Subversion to Git Migration
Git - Intro to the Basics of DVCS
Fabric8 CI/CD
From SVN to Git
Git & gitflow
Docker e git lab
Introducing Koki Short
FOSDEM 2017: GitLab CI
Kompose
Subversion to Git Migration
Kubernetes Basic Operation
Microservices on Kubernetes - The simple way
通过 Ktor 迅速打造以 Kotlin 为核心的后端服务应用
Ad

Similar to Effective Git (20)

PPTX
Git Obstacle Course: Stop BASHing your head and break down the basics
PPTX
Git, YouTrack and TeamCity - DDDSydney 2011
PDF
The journey to GitOps
PDF
(Declarative) Jenkins Pipelines
PDF
Gitlab and Lingvokot
PDF
Gerrit linuxtag2011
PDF
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
PPT
Life of a Chromium Developer
PPTX
git github PPT_GDSCIIITK.pptx
PDF
Javascript, the GNOME way (JSConf EU 2011)
PDF
PVS-Studio in the Clouds: CircleCI
PPTX
Untangling fall2017 week2
PPTX
Untangling fall2017 week2_try2
PPTX
Mini-training: Let’s Git It!
PPT
Git Heaven with Wakanda
PDF
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
PPTX
Introduction to git and Github
PDF
Rc094 010d-git 2 - desconocido
Git Obstacle Course: Stop BASHing your head and break down the basics
Git, YouTrack and TeamCity - DDDSydney 2011
The journey to GitOps
(Declarative) Jenkins Pipelines
Gitlab and Lingvokot
Gerrit linuxtag2011
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
Life of a Chromium Developer
git github PPT_GDSCIIITK.pptx
Javascript, the GNOME way (JSConf EU 2011)
PVS-Studio in the Clouds: CircleCI
Untangling fall2017 week2
Untangling fall2017 week2_try2
Mini-training: Let’s Git It!
Git Heaven with Wakanda
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Introduction to git and Github
Rc094 010d-git 2 - desconocido
Ad

More from Konrad Malawski (20)

PDF
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
PDF
Akka Typed (quick talk) - JFokus 2018
PDF
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
PDF
State of Akka 2017 - The best is yet to come
PDF
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
PDF
Akka-chan's Survival Guide for the Streaming World
PDF
Reactive integrations with Akka Streams
PDF
Not Only Streams for Akademia JLabs
PDF
Reactive Streams, j.u.concurrent & Beyond!
PDF
End to End Akka Streams / Reactive Streams - from Business to Socket
PDF
The Cloud-natives are RESTless @ JavaOne
PDF
Akka Streams in Action @ ScalaDays Berlin 2016
PDF
Krakow communities @ 2016
PDF
The things we don't see – stories of Software, Scala and Akka
PDF
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
PDF
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
PDF
Zen of Akka
PDF
How Reactive Streams & Akka Streams change the JVM Ecosystem
PDF
The Need for Async @ ScalaWorld
PDF
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka Streams
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Akka Typed (quick talk) - JFokus 2018
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
State of Akka 2017 - The best is yet to come
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Akka-chan's Survival Guide for the Streaming World
Reactive integrations with Akka Streams
Not Only Streams for Akademia JLabs
Reactive Streams, j.u.concurrent & Beyond!
End to End Akka Streams / Reactive Streams - from Business to Socket
The Cloud-natives are RESTless @ JavaOne
Akka Streams in Action @ ScalaDays Berlin 2016
Krakow communities @ 2016
The things we don't see – stories of Software, Scala and Akka
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
Zen of Akka
How Reactive Streams & Akka Streams change the JVM Ecosystem
The Need for Async @ ScalaWorld
Fresh from the Oven (04.2015): Experimental Akka Typed and Akka Streams

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
MYSQL Presentation for SQL database connectivity
PPT
Teaching material agriculture food technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Programs and apps: productivity, graphics, security and other tools
Diabetes mellitus diagnosis method based random forest with bat algorithm
Building Integrated photovoltaic BIPV_UPV.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
MYSQL Presentation for SQL database connectivity
Teaching material agriculture food technology
Chapter 3 Spatial Domain Image Processing.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Per capita expenditure prediction using model stacking based on satellite ima...
Dropbox Q2 2025 Financial Results & Investor Presentation

Effective Git

  • 5. a distributed open source version control system
  • 6. is also fast reliable powerful popular
  • 8. •  it is too new •  not tested •  does not provide backups (sic!) •  does not like windows •  does not support ... •  it's not subversion
  • 9. Git is "simple" but hard. Subversion is "easy", but eventually complex. Thomas Nicolaisen (http://blog.tfnico.com/2011/11/some-thoughts-on-git-vs-complexity.html)
  • 10. git config --global user.name Sheldon Cooper git config --global user.email bazinga@bigbang.com git config --global color.ui true
  • 13. •  cherry-pick •  rebase (interactive) •  interactive add •  submodules •  git svn •  git sh
  • 18. # initialize a submodule git submodule add git://llp.pl/common.git common # initial pull of it's contents git submodule init # pull pointed to commit (and overwrite your changes) git submodule update
  • 20. cd common git pull cd .. # Warning! Add the dir without trailing "/” git add common git commit -m "Latest common submodule commit"
  • 23. ... or "Why merge isn't enough?"
  • 33. Keeping commit info in UI of the running app, results in better (or less!) bug reports :-)
  • 34. Or expose full details, for developers only @Inject GitRepositoryState repoState; @GET @Path("/git") public GitRepositoryState getRepoState() { return repoState; } { "branch" : "testing-maven-git-plugin", "commitTime" : "06.01.1970 @ 16:16:26 CET", "commitId" : "787e39f61f99110e74deed68ab9093088d64b969", "commitIdAbbrev" : "787e39f", "commitUserName" : "Konrad Malawski", "commitUserEmail" : "konrad.malawski@java.pl", "commitMessageFull" : "releasing my fun plugin :-) + fixed some typos + cleaned up directory structure + added license etc", "commitMessageShort" : "releasing my fun plugin :-)", "buildTime" : "06.01.1970 @ 16:17:53 CET", "buildUserName" : "Konrad Malawski", "buildUserEmail" : "konrad.malawski@java.pl" }
  • 36. De facto standard of viewing git-based repositories Just point it to the repo Works through Apache and CGI
  • 37. simple, read/write permissions per-repository ssh-key based authentication but it's trivial to expose config file via f.ex. Grails frontend
  • 38. online code review (like ReviewBoard, but better ;-)) also hosts git repositories review commits before they enter a branch
  • 39.     with some help         by the power of Jenkins,              allows to have pre-tested commits
  • 42. Git immersion: http://library.edgecase.com/git_immersion/index.html On branching with Git http://nvie.com/posts/a-successful-git-branching-model/ Pro Git book (creative commons) www.progit.org Git-scm.com Git.wiki.kernel.org