Upload
andrzej-grzesik
View
651
Download
4
Embed Size (px)
DESCRIPTION
Citation preview
git Andrzej Grzesik
Konrad Malawski LunarLogicPolska
Andrzej Grzesik
past
Konrad Malawski
Questions? Ask them right away!
intro a distributed
open source version control system
intro is also fast reliable powerful popular
it’s proven
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
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)
basics !git config --global user.name Sheldon Cooper!git config --global user.email [email protected]!git config --global color.ui true!
basics
everybody knows that
way beDer than svn • cherry-pick • rebase (interactive) • interactive add • submodules • git svn • git sh
space efficient
git cherry-‐‑pick
git cherry pick
git submodules
# 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
git submodules
cd common git pull cd .. # Warning! Add the dir without trailing "/” git add common git commit -m "Latest common submodule commit"
updating a submodule
git submodules
what does the log show?
... or "Why merge isn't enough?"
git rebase
git rebase
git rebase
git rebase
git svn
git svn
git svn
git svn
git svn
git commit id maven plugin https://github.com/ktoso/maven-git-commit-id-plugin
git commit id maven plugin Keeping commit info in UI of the running app, results in better (or less!) bug reports :-)
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; }
let’s be served!
gitweb 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
gitosis
online code review (like ReviewBoard, but better ;-)) also hosts git repositories
review commits before they enter a branch
gerrit
with some help by the power of Jenkins, allows to have pre-tested commits
gerrit
gerrit quickly
git + jenkins
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