Git

887 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
887
On SlideShare
0
From Embeds
0
Number of Embeds
41
Actions
Shares
0
Downloads
12
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Git

  1. 1. git Andrzej Grzesik Konrad Malawski LunarLogicPolska
  2. 2. Andrzej  Grzesik past
  3. 3. Konrad  Malawski
  4. 4. Questions? Ask them right away!
  5. 5. intro a distributed open source version control system
  6. 6. intro is also fast reliable powerful popular
  7. 7. it’s  proven
  8. 8. still,  “git  go  away”   •  it is too new•  not tested•  does not provide backups (sic!)•  does not like windows•  does not support ...•  its not subversion
  9. 9. 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)
  10. 10. basics !git config --global user.name Sheldon Cooper!git config --global user.email bazinga@bigbang.com!git config --global color.ui true!
  11. 11. basics
  12. 12. everybody  knows  that
  13. 13. way  beDer  than  svn •  cherry-pick•  rebase (interactive)•  interactive add•  submodules•  git svn•  git sh
  14. 14. space  efficient
  15. 15. git  cherry-­‐‑pick
  16. 16.                      git  cherry      pick
  17. 17. git  submodules
  18. 18. adding  submodule # initialize a submodulegit submodule add git://llp.pl/common.git common# initial pull of its contentsgit submodule init# pull pointed to commit (and overwrite your changes)git submodule update
  19. 19. git  submodules
  20. 20. updating  a  submodule cd commongit pullcd ..# Warning! Add the dir without trailing "/”git add commongit commit -m "Latest common submodule commit"
  21. 21. git  submodules
  22. 22. what  does  the  log  show?
  23. 23. git  rebase ... or "Why merge isnt enough?"
  24. 24. git  rebase
  25. 25. git  rebase
  26. 26. git  rebase
  27. 27. git  svn
  28. 28. git  svn
  29. 29. git  svn
  30. 30. git  svn
  31. 31. git  svn
  32. 32. git commit id maven plugin https://github.com/ktoso/maven-git-commit-id-plugin
  33. 33. git commit id maven plugin Keeping commit info in UI of the running app, results in better (or less!) bug reports :-)
  34. 34. git commit id maven plugin Or expose full details, for developers only@InjectGitRepositoryState 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" }
  35. 35. let’s  be  served!
  36. 36. gitweb De facto standard of viewing git-based repositoriesJust point it to the repoWorks through Apache and CGI
  37. 37. gitosis simple, read/write permissionsper-repositoryssh-key based authenticationbut its trivial to expose config file via f.ex. Grails frontend
  38. 38. gerrit online code review(like ReviewBoard, but better ;-))also hosts git repositories review commits before they enter a branch
  39. 39. gerrit     with some help        by the power of Jenkins,             allows to have pre-tested commits
  40. 40. gerrit  quickly
  41. 41. git  +  jenkins
  42. 42. resources Git immersion:http://library.edgecase.com/git_immersion/index.htmlOn branching with Githttp://nvie.com/posts/a-successful-git-branching-model/Pro Git book (creative commons)www.progit.orgGit-scm.comGit.wiki.kernel.org

×