git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Magnus Bäck" <baeck@google.com>
To: "J.V." <jvsrvcs@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: which files will have conflicts between two branches?
Date: Thu, 28 Mar 2013 12:17:18 -0400	[thread overview]
Message-ID: <20130328161717.GC23946@google.com> (raw)
In-Reply-To: <5153694B.2010405@gmail.com>

On Wednesday, March 27, 2013 at 17:48 EDT,
     "J.V." <jvsrvcs@gmail.com> 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@google.com

      reply	other threads:[~2013-03-28 16:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-27 21:48 which files will have conflicts between two branches? J.V.
2013-03-28 16:17 ` Magnus Bäck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130328161717.GC23946@google.com \
    --to=baeck@google.com \
    --cc=git@vger.kernel.org \
    --cc=jvsrvcs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).