From: Jon Smirl <jonsmirl@gmail.com>
To: skillzero@gmail.com
Cc: git@vger.kernel.org
Subject: Re: Merge into locally modified files?
Date: Mon, 8 Jun 2009 19:19:37 -0400 [thread overview]
Message-ID: <9e4733910906081619u19f12220g7fab11c94b9aa8a5@mail.gmail.com> (raw)
In-Reply-To: <2729632a0906081030k5048cb27p6950a0decaa7396a@mail.gmail.com>
On Mon, Jun 8, 2009 at 1:30 PM, <skillzero@gmail.com> wrote:
> 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 use stgit to do this all of the time. stgit is all about patch
stacks. You just add your debug stuff to a stgit patch and then you
can push/pop it.
stg new debug-patch
..make debug edits..
stg refresh
git fetch origin
stg rebase origin/master
... fix conflicts, you get prompted...
you're done.
>
> 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.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Jon Smirl
jonsmirl@gmail.com
prev parent reply other threads:[~2009-06-08 23:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-08 17:30 Merge into locally modified files? skillzero
2009-06-08 18:22 ` 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 [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=9e4733910906081619u19f12220g7fab11c94b9aa8a5@mail.gmail.com \
--to=jonsmirl@gmail.com \
--cc=git@vger.kernel.org \
--cc=skillzero@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).