Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to get a list of merged files in git?
    text
    copied!<p>For a given merge commit, how can I find out which files combined changes from two or more parents (with or without conflict)?</p> <p>And, here is an example, just for good measure:</p> <pre><code>A -- B -- C -- E-- .. \-- D --/ </code></pre> <p>I have the following files</p> <ul> <li>B has f1, f2, f3, f5, f6</li> <li>C modifies f1 and f3. Removes f2</li> <li>D modifies f1, f3, and f6. Adds f4.</li> <li>E is the merge commit, has f1, f3, f4, f5 and f6. </li> </ul> <p>I am looking for the git command that returns the list "f1 f3" in E, because in E, those are the only two files that were changed by <strong>both C and D</strong>. All others were either not touched, or updated by a single parent only.</p> <p>The use case is the following: A company has an SCM (not git) in which developers commit changesets (list of files) to a temporary branch. The commit needs to pass through a scrutiny of tests and peer review, before it could be accepted to the main development branch. Occasionally (and by that I mean frequently), development branch progresses after the commit, at which time some of the files needs to be merged (and remerged) before they could be accepted to the development branch. </p> <p>In the above example, bottom line represents the temporary branch and D is my under-review changeset. The top line is the main dev branch and C is the commit that moved on in the meantime. In E, I have my changes approved and have updated and merged with the new dev-branch. Now the task is to come up with a list of files that I need to push upstream to the company SCM (remember, that is a manual changeset I need to come up with). Among the files that were changed in E are those that I have modified or added in D and have already pushed upstream and have no counterparts or were not touched in the dev branch (in C). And also in E are the files that were modified in the dev branch by others and I had nothing to do with. These are the files with a <strong>single</strong> parent. The remainder are the files that were merged (automatically by Git, or by myself in case of conflicts). And that is the list I need to push up. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload