From: Chris Marshall <christopher.marshall@merchantlink.com>
To: git@vger.kernel.org
Subject: merging individual files
Date: Thu, 13 Aug 2009 20:16:52 +0000 (UTC) [thread overview]
Message-ID: <loom.20090813T192334-7@post.gmane.org> (raw)
Suppose that merging branch dev1 into master would result in three files, f1,
f2, and f3 being changed, and that I only want to merge the changes for f1 and
f2 and not the changes for f3 currently. Later on, I want to accept the f3
changes. Suppose further that the changes to f1, f2, and f3 occurred in a
single commit to branch dev1.
What is the simplest way to use git to achieve that effect?
More generally, I need a way to accept the changes for one or two files while
rejecting the changes for a potentially large number of files, then later on
accepting the changes for the large number of files.
I work at a company where perforce is currently used for all development and am
trying to work out the git equivalents to all of the perforce flows we use.
This workflow is the only one that I am stumped on.
One solution that occurs to me is to create a temporary branch off of the (most
recent) common ancestor of master and br1, let's say br2, checkout the files
from br1 that I want to merge into master and commit those to br2, then merge
br2 into master:
git checkout common_ancestor_commit
git checkout -b br2
git checkout br1 f1 f2
git commit
git checkout master
git merge br2
git branch -d br2
This strikes me as not too bad of a procedure, as long as there is a graceful
way of determining the most recent common ancestor of br1 and master. What's
the simplest way of doing that?
next reply other threads:[~2009-08-13 20:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-13 20:16 Chris Marshall [this message]
2009-08-14 7:55 ` merging individual files Michael J Gruber
2009-08-14 14:31 ` Chris Marshall
2009-08-14 15:28 ` Michael J Gruber
2009-08-14 16:05 ` Michael J Gruber
2009-08-14 16:14 ` Chris Marshall
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=loom.20090813T192334-7@post.gmane.org \
--to=christopher.marshall@merchantlink.com \
--cc=git@vger.kernel.org \
/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