Re: which files will have conflicts between two branches?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, March 27, 2013 at 17:48 EDT,
     "J.V." <jvsrvcs@xxxxxxxxx> 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
baeck@xxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]