0
Git 101 Or, How to sanely manage your Koha customizations
Who am I? <ul><li>Ian Walls
Lead Development Specialist at ByWater Solutions
Koha 3.6 QA Manager
Geek </li></ul>
What is Git? Git is a free and open source distributed version control system invented by Linus Torvalds (the Linux guy).
Why Git? <ul><li>Distributed: everyone has the complete history of changes to the project stored locally
Manages content, not files
Multiple development lines can be followed concurrently </li></ul>
Basic Terminology <ul><li>Repository (repo): the complete history of the project
Index: the current file contents you have
Commit:  a saved change to the Index
Branch: a chain of Commits
Checkout: to choose a Commit, and load the Index associated with it
Patch: a Commit formatted as a file (for sending to others) </li></ul>
Repository Structure bard dug kat bard dug cat bird dog cat rat bird dog cat
Branch Structure HEAD master branch1 master branch2 branch3 HEAD HEAD HEAD merge merge
Bad repo v. Good repo
That's great... Howz this aply to me? Huwz this aply to me?
Git and Koha <ul><li>Installation of Git
Cloning the Koha repository
Making a branch
Committing a change
Submitting a patch
Updating your repository
Upcoming SlideShare
Loading in...5
×

Git 101, or, how to sanely manage your Koha customizations

8,335

Published on

Presentation for KUDOS conference in Madison, WI, May 2-3, 2011

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

No Downloads
Views
Total Views
8,335
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
32
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Git 101, or, how to sanely manage your Koha customizations"

  1. 1. Git 101 Or, How to sanely manage your Koha customizations
  2. 2. Who am I? <ul><li>Ian Walls
  3. 3. Lead Development Specialist at ByWater Solutions
  4. 4. Koha 3.6 QA Manager
  5. 5. Geek </li></ul>
  6. 6. What is Git? Git is a free and open source distributed version control system invented by Linus Torvalds (the Linux guy).
  7. 7. Why Git? <ul><li>Distributed: everyone has the complete history of changes to the project stored locally
  8. 8. Manages content, not files
  9. 9. Multiple development lines can be followed concurrently </li></ul>
  10. 10. Basic Terminology <ul><li>Repository (repo): the complete history of the project
  11. 11. Index: the current file contents you have
  12. 12. Commit: a saved change to the Index
  13. 13. Branch: a chain of Commits
  14. 14. Checkout: to choose a Commit, and load the Index associated with it
  15. 15. Patch: a Commit formatted as a file (for sending to others) </li></ul>
  16. 16. Repository Structure bard dug kat bard dug cat bird dog cat rat bird dog cat
  17. 17. Branch Structure HEAD master branch1 master branch2 branch3 HEAD HEAD HEAD merge merge
  18. 18. Bad repo v. Good repo
  19. 19. That's great... Howz this aply to me? Huwz this aply to me?
  20. 20. Git and Koha <ul><li>Installation of Git
  21. 21. Cloning the Koha repository
  22. 22. Making a branch
  23. 23. Committing a change
  24. 24. Submitting a patch
  25. 25. Updating your repository
  26. 26. Signing off on others' patches </li></ul>
  27. 27. Installing Git <ul><li>On Debian: sudo apt-get install git-core
  28. 28. On Ubuntu: sudo apt-get install git git-email
  29. 29. On Mac OSX: download git-osx-installer ( http://code.google.com/p/git-osx-installer/ )
  30. 30. On Windows: Don't. </li></ul>
  31. 31. Some quick Git config <ul><li>git config --global user.name &quot;your NAME&quot;
  32. 32. git config --global user.email &quot;your@mail.com&quot;
  33. 33. Other configs are possible. All stored in: .gitconfig </li></ul>
  34. 34. Cloning the Koha repo <ul><li>git clone git://git.koha-community.org/koha.git kohaclone
  35. 35. Wait...
  36. 36. cd kohaclone </li></ul>
  37. 37. Branching <ul><li>Show all branches (current has *): git branch
  38. 38. Show current branch and other info: git status
  39. 39. Create your branch: git checkout -b mybranch master </li></ul>
  40. 40. Finding something to fix <ul><li>Talk to your librarians
  41. 41. Talk to your patrons
  42. 42. FILE A BUG REPORT!!! on http://bugs.koha-community.org
  43. 43. Bigger idea? Post an RFC on http://wiki.koha-community.org </li></ul>
  44. 44. Making a Change
  45. 45. Committing a Change <ul><li>For each file you changed: </li><ul><li>git add path/to/the.file </li></ul><li>git commit
  46. 46. Or, more lazily: git commit -a
  47. 47. Write your commit message. It should begin with the bug number, then a brief one-line description of the bug. </li></ul>
  48. 48. Publishing your Commit <ul><li>git format-patch master
  49. 49. You'll see something like “0001-BugXXXX--....fix.patch”
  50. 50. git send-email -to koha-patches@lists.koha-community.org “0001-BugXXXX--....fix.patch” </li></ul>
  51. 51. The Paperwork <ul><li>File a bug report!
  52. 52. For bigger developments, post an RFC to the wiki with detailed functionality
  53. 53. After emailing patch, attach the patch to the bug report and label bug “needs signoff”
  54. 54. After signing off, label bug “signed off”. If the patch isn't attached to the bug report, do it now </li></ul>
  55. 55. Why the attachment? <ul><li>Puts the solution with the problem; saves search in the patches list
  56. 56. Easy to fetch an attached patch:
  57. 57. wget -O bugXXXX.patch http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=YYYY </li></ul>
  58. 58. Code Acceptance Process <ul><li>Patch goes to patches listserv
  59. 59. Someone in the community tests and signs off
  60. 60. Quality Assurance Manager tests, and signs off
  61. 61. Release Manager commits to Koha </li></ul>
  62. 62. Keeping up with Changes <ul><li>git checkout master
  63. 63. git pull
  64. 64. git checkout mybranch
  65. 65. git rebase master
  66. 66. You may need to deal with merge conflicts... Submit Early and Submit Often </li></ul>
  67. 67. Sign-offs <ul><li>git am -i -u -3 bugXXXX.patch (Tap 'y' to confirm)
  68. 68. TEST TEST TEST
  69. 69. git commit –-amend change the first line of the commit message to begin with [SIGNED-OFF]
  70. 70. git format-patch -s master
  71. 71. git send-email ... </li></ul>
  72. 72. Course Complete! I can haz diploma? Teh sink ate yurs
  73. 73. Questions? <ul><li>Checkout http://wiki.koha-community.org/wiki/Version_Control_Using_Git for more details
  74. 74. Log on to Koha IRC: we're here to help! </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×