| 1 | = Git = |
| 2 | [[TOC]] |
| 3 | Sahana Eden has decided to move from !Bzr/LaunchPad to !Git/GitHub |
| 4 | == Why? == |
| 5 | * The current repository is huge & bloated, taking too long to download. |
| 6 | * Even simple changes take an age to Pull down to servers |
| 7 | * Web2py no longer supports !Bzr/LaunchPad, so we want to be able to maintain a common tool to work with both repositories. |
| 8 | * New developers are likely to be more familiar with !Git/GitHub |
| 9 | == How? == |
| 10 | The preferred approach is to have a clean repository, in order to get the maximum benefit from the migration...although it is technically possible to [http://fearthecowboy.com/2011/04/29/converting-bazaar-repositories-to-git/ migrate the commit history]. Commit History will instead be maintained on the !LaunchPad site as an archive |
| 11 | === Migrating Branches === |
| 12 | Fork on !GitHub: https://github.com/flavour/eden/fork_select |
| 13 | {{{ |
| 14 | mv eden <mybranch> |
| 15 | git clone git@github.com:<mygitusername>/eden.git |
| 16 | cd eden |
| 17 | diff -u ../<mybranch> > ../mybranch.diff |
| 18 | patch -p0 < ../mybranch.diff |
| 19 | git commit -a |
| 20 | git push origin master |
| 21 | git remote add upstream git://github.com/flavour/eden.git |
| 22 | }}} |
| 23 | === Developer Workflow === |
| 24 | We suggest adopting the [http://blog.hasmanythrough.com/2008/12/18/agile-git-and-the-story-branch-pattern Story Branch] pattern, which allows squashing commits in order to keep the main origin |
| 25 | {{{ |
| 26 | cd <mybranch> |
| 27 | |
| 28 | }}} |
| 29 | === Developer Configuration === |
| 30 | {{{ |
| 31 | git config --global user.name "Your Name" |
| 32 | git config --global user.email your@email.com |
| 33 | git config --global github.user yourgithubusername |
| 34 | git config --global github.token yourtoken |
| 35 | git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin" |
| 36 | git config --global merge.tool diffmerge |
| 37 | git config --global diff.tool diffmerge |
| 38 | git config --global difftool.diffmerge.cmd 'C:/Program Files (x86)/Git/etc/wrappers/git-diff-diffmerge-wrapper.sh' "$LOCAL" "$REMOTE" |
| 39 | git config --global difftool.prompt false |
| 40 | git config --global merge.tool diffmerge |
| 41 | git config --global mergetool.diffmerge.cmd 'C:/Program Files (x86)/Git/etc/wrappers/git-merge-diffmerge-wrapper.sh' "$PWD/$LOCAL" "$PWD/$BASE" "$PWD/$REMOTE" "$PWD/$MERGED" |
| 42 | git config --global mergetool.prompt false |
| 43 | git config --global mergetool.trustExitCode false |
| 44 | git config --global mergetool.keepBackup false |
| 45 | }}} |
| 46 | ==== Windows ==== |
| 47 | Install [http://sourceforge.net/projects/console/ Console] & [http://www.sourcegear.com/diffmerge/downloads.php Diffmerge] & [http://markembling.info/2009/09/my-ideal-powershell-prompt-with-git-integration configure Powershell]. |
| 48 | === Developer Tools === |
| 49 | Pre-commit hook to update VERSION (& run tests?), e.g. based on http://tech.yipit.com/2011/11/16/183772396/ |
| 50 | == Resources == |
| 51 | * Community Book: http://book.git-scm.com |
| 52 | * Tips & Tricks: http://gitready.com |