42
git Andrzej Grzesik Konrad Malawski LunarLogicPolska

Git

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Git

git Andrzej Grzesik

Konrad Malawski LunarLogicPolska

Page 2: Git

Andrzej  Grzesik

past

Page 3: Git

Konrad  Malawski

Page 4: Git

Questions? Ask them right away!

Page 5: Git

intro a distributed

open source version control system

Page 6: Git

intro is also fast reliable powerful popular

Page 7: Git

it’s  proven

Page 8: Git

still,  “git  go  away”   •  it is too new •  not tested •  does not provide backups (sic!) •  does not like windows •  does not support ... •  it's not subversion

Page 9: Git

git  is  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)

Page 10: Git

basics !git config --global user.name Sheldon Cooper!git config --global user.email [email protected]!git config --global color.ui true!

Page 11: Git

basics

Page 12: Git

everybody  knows  that

Page 13: Git

way  beDer  than  svn •  cherry-pick •  rebase (interactive) •  interactive add •  submodules •  git svn •  git sh

Page 14: Git

space  efficient

Page 15: Git

git  cherry-­‐‑pick

Page 16: Git

                     git  cherry      pick

Page 17: Git

git  submodules

Page 18: 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

adding  submodule

Page 19: Git

git  submodules

Page 20: Git

cd common git pull cd .. # Warning! Add the dir without trailing "/” git add common git commit -m "Latest common submodule commit"

updating  a  submodule

Page 21: Git

git  submodules

Page 22: Git

what  does  the  log  show?

Page 23: Git

... or "Why merge isn't enough?"

git  rebase

Page 24: Git

git  rebase

Page 25: Git

git  rebase

Page 26: Git

git  rebase

Page 27: Git

git  svn

Page 28: Git

git  svn

Page 29: Git

git  svn

Page 30: Git

git  svn

Page 31: Git

git  svn

Page 32: Git

git commit id maven plugin https://github.com/ktoso/maven-git-commit-id-plugin

Page 33: Git

git commit id maven plugin Keeping commit info in UI of the running app, results in better (or less!) bug reports :-)

Page 34: Git

git commit id maven plugin

{ "branch" : "testing-maven-git-plugin", "commitTime" : "06.01.1970 @ 16:16:26 CET", "commitId" : "787e39f61f99110e74deed68ab9093088d64b969", "commitIdAbbrev" : "787e39f", "commitUserName" : "Konrad Malawski", "commitUserEmail" : "[email protected]", "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" : "[email protected]" }

Or expose full details, for developers only

@Inject GitRepositoryState repoState; @GET @Path("/git") public GitRepositoryState getRepoState() { return repoState; }

Page 35: Git

let’s  be  served!

Page 36: Git

gitweb De facto standard of viewing git-based repositories Just point it to the repo Works through Apache and CGI

Page 37: Git

simple, read/write permissions per-repository ssh-key based authentication but it's trivial to expose config file via f.ex. Grails frontend

gitosis

Page 38: Git

online code review (like ReviewBoard, but better ;-)) also hosts git repositories

review commits before they enter a branch

gerrit

Page 39: Git

    with some help         by the power of Jenkins,              allows to have pre-tested commits

gerrit

Page 40: Git

gerrit  quickly

Page 41: Git

git  +  jenkins

Page 42: Git

resources 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