git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: skillzero@gmail.com
To: git@vger.kernel.org
Subject: Merge into locally modified files?
Date: Mon, 8 Jun 2009 10:30:22 -0700	[thread overview]
Message-ID: <2729632a0906081030k5048cb27p6950a0decaa7396a@mail.gmail.com> (raw)

If I have some local changes to a file that I don't want to commit
(e.g. temp debug changes like printf's) and I see somebody else has
pushed some changes to that file, how do I merge their changes to the
file while trying to preserve my local changes (and conflicting if
it's not possible)?

After a git fetch, I tried 'git checkout --merge origin/master <path
to my locally modified file>', but that just overwrote my local
changes.

I'm converting people from CVS to git and this is a common thing
people do with CVS. They have some local changes and see that the
server has some other changes so they do 'cvs up' and it tries to
merge changes from the server into the locally modified file. The
local changes are often things that will never be committed. I know
git tries to avoid things you can't undo, but like a 'git checkout
<file>' that can't be undone, is there a way to say "merge what you
can and generate conflict markers for things you can't?".

I think what I want to do is the equivalent of rebasing for local
modified files rather than committed files.

             reply	other threads:[~2009-06-08 17:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08 17:30 skillzero [this message]
2009-06-08 18:22 ` Merge into locally modified files? Johan Herland
2009-06-08 19:14   ` skillzero
2009-06-08 22:36     ` Johan Herland
2009-06-09  0:46     ` Sitaram Chamarty
2009-06-08 23:10 ` Andreas Ericsson
2009-06-08 23:19 ` Jon Smirl

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=2729632a0906081030k5048cb27p6950a0decaa7396a@mail.gmail.com \
    --to=skillzero@gmail.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;
as well as URLs for NNTP newsgroup(s).