Jan 20
The part of the file that is of interest is in between the "++<<<<<<<" and "++>>>>>>>" prefix and suffix. You will need to decide whether to add or not the enclosed code into your local file.On the Mac, I prefer to use "opendiff", a tool that is part of Apple's XCode. To start it type:
When you are done, type:
Git: How to merge two repositories
Say that you have created a clone of a Git repository. Lets name the original repository A, and your clone B.You have been working on B, but you are not ready to commit any changes yet. In the mean time, other people have been committing great new features in A, and you'd like to get those features integrated into B.In this case, you need to pull repository A into B. However, there may be conflicts reported by Git, so you will need to resolve those conflicts before proceeding again with the pull.Here's a step-by-step of this process:1. Go in your local git repository and type:git pull git://gitorious.org/gitorious/mainline.git masterReplace "git://gitorio...line.git" with the location of the remote repository, and "master" with the name of the branch you'd like to merge with.2. If Git doesn't give you any conflict messages, you're done. If it does, it will tell you which files have conflicts. You will need to resolve those conflicts by editing the files. So, lets say you have this conflict message from git:CONFLICT (content): Merge conflict in app/views/trees/show.html.erb
Automatic merge failed; fix conflicts and then commit the result.Use a text editor of your choice to open show.html.erb. You will see something like this:<% end -%> <<<<<<< HEAD:app/views/trees/show.html.erb <% if last_commit = commit_for_tree_path(@repository, node.name) -%> <td class="meta"><%= last_commit.committed_date.to_s(:short) -%></td> <td class="meta commit_message"> <%= link_to truncate(h(last_commit.message), 75, "…"), commit_path(last_commit.id) -% </td> <% else -%> ======= <% if node.is_a? Grit::Submodule -%> >>>>>>> ab3c1984c0914a0f64af16cb8b5bb5c3e98b3629:app/views/trees/show.html.erb <td class="meta"></td>
git mergetoolThis will start opendiff and display a split window where the local file is on the left and the remote on the right sides. You can see graphically the differences between the files and insert the code in the appropriate places.When you are done, type:
git commit...and you are done. If you don't use the -m switch, git will pre-populate the log with a description of the merge.
