Subject: Re: which files will have conflicts between two branches?

From: Magnus Bäck <[email-masked]>
Date: Thu, 28 Mar 2013 12:17:18 -0400

On Wednesday, March 27, 2013 at 17:48 EDT,
     "J.V." <[email-masked]> wrote:

> I have two local branches (tracked to remote) that are in sync (did
> a git pull on both branches from their corresponding remote).
> 
> Is this the best way to merge?
> 
> I would be merging local/branch1 => local/branch2 (test this branch)
> and then push local/branch2 => origin/branch1  (and would expect no
> merge conflicts if anyone has not checked in anything.

Except for maybe unusual corner cases I don't see how the merge order
(branch1 into branch2 or vice versa) makes any difference. If nothing
has happened with origin/branch1 since you merged from it to your local
branches the push will succeed. If there have been upstream commits
you'll have to update your local branch first (which might result in
conflicts) before you'll be able to push.

> Also with two local branches, Is there a way to get a list of files
> (one line per file) of files that would have merge conflicts that
> would need to be resolved?

You'd have to perform an actual merge for that, perhaps with
--no-commit to avoid creating the actual commit object. Inspect the
"git status" output to find the files with conflicts. In a script,
use "git ls-files -u" instead.

-- 
Magnus Bäck
[email-masked]