| | 184 | == Fixing conflicts == |
| | 185 | |
| | 186 | During a merge, you can often stumble upon one, two or several thousands of conflicts: |
| | 187 | |
| | 188 | {{{ |
| | 189 | #!sh |
| | 190 | $ git merge feature_X |
| | 191 | ... |
| | 192 | Automatic merge failed; fix conflicts and then commit the result. |
| | 193 | }}} |
| | 194 | |
| | 195 | In this case I would first suggest to configure `git` to present the conflicts with the so-called `diff3` style ([http://stackoverflow.com/questions/161813/how-do-i-fix-merge-conflicts-in-git thanks CoolAJ86]), which is: |
| | 196 | |
| | 197 | {{{ |
| | 198 | <<<<<<< |
| | 199 | Changes made on the branch that is being merged into. In most cases, |
| | 200 | this is the branch that I have currently checked out (i.e. HEAD). |
| | 201 | ||||||| |
| | 202 | The common ancestor version. |
| | 203 | ======= |
| | 204 | Changes made on the branch that is being merged in. This is often a |
| | 205 | feature/topic branch. |
| | 206 | >>>>>>> |
| | 207 | }}} |
| | 208 | |
| | 209 | It ''really'' helps you better understand the conflicts. |
| | 210 | You can configure it with: |
| | 211 | |
| | 212 | {{{ |
| | 213 | #!sh |
| | 214 | $ git merge --abort |
| | 215 | $ git config merge.conflictstyle diff3 |
| | 216 | }}} |
| | 217 | |
| | 218 | Then, [http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging#Basic-Merge-Conflicts as usual], fix conflicts, and commit: |
| | 219 | |
| | 220 | {{{ |
| | 221 | $ git merge |
| | 222 | ... |
| | 223 | Auto-merging Makefile.am |
| | 224 | CONFLICT (content): Merge conflict in Makefile.am |
| | 225 | Automatic merge failed; fix conflicts and then commit the result. |
| | 226 | $ vim Makefile.am |
| | 227 | ...fix... |
| | 228 | $ git add Makefile.am |
| | 229 | $ git commit |
| | 230 | }}} |
| | 231 | |
| | 232 | ...and now you can proceed with the [wiki:GitCreateBundle#Creatingandsubmittingabundle bundle]. |