| 111 | == Tracking SVN branches with GIT == |
| 112 | |
| 113 | Start svn branch in git. |
| 114 | {{{ |
| 115 | git svn branch -m "Branch for work on extra cool feature" extra_cool_feature |
| 116 | git checkout extra_cool_feature_local remotes/extra_cool_feature # to avoid warning from git about ambiguity |
| 117 | ... hack/git commit/git commit --amend/git rebase -i HEAD~10/... as usual |
| 118 | }}} |
| 119 | |
| 120 | dcommit to svn |
| 121 | {{{ |
| 122 | git svn dcommit --dry-run # check that it will commit to proper svn branch. |
| 123 | git svn dcommit |
| 124 | }}} |
| 125 | |
| 126 | Merging trunk into branch |
| 127 | {{{ |
| 128 | git checkout master |
| 129 | git svn rebase |
| 130 | git checkout extra_cool_branch |
| 131 | git merge --squash master |
| 132 | git commit -m "Bring branch up-to-date with trunk" |
| 133 | }}} |
| 134 | |
| 135 | Merging branch back to trunk |
| 136 | {{{ |
| 137 | git checkout master |
| 138 | git svn rebase |
| 139 | git merge --squash extra_cool_feature |
| 140 | git commit -m "Merge branch into trunk" |
| 141 | }}} |
| 142 | |
| 143 | Hints and caveats: |
| 144 | |
| 145 | 1. Don't try to rebase already dcommited changes. They are not belong to you anymore. |
| 146 | |
| 147 | 2. Always run "git svn dcommit --dry-run" before real commit to check in which branch your changes will be committed. |
| 148 | |
| 149 | 3. Always merge branches with "--squash". Otherwise git-svn will do it for you and can epicly fail sometime. |
| 150 | |
| 151 | 4. svn isn't smart enough to track merges. So, don't try to merge branches with pure svn and git-svn on same branch. |
| 152 | |
| 153 | |
| 154 | |