From: "Neal Kreitzinger" <neal@rsss.com>
To: git@vger.kernel.org
Subject: Re: Revert-style merge/Working tree-only checkout?
Date: Tue, 14 Dec 2010 08:36:20 -0600 [thread overview]
Message-ID: <ie7veg$ks5$1@dough.gmane.org> (raw)
In-Reply-To: AANLkTi=ioX25aqXg-yWDA0oXBTATkFe+J25g-dB7-psS@mail.gmail.com
"Yuriy Romanenko" <groman@gmail.com> wrote in message
news:AANLkTi=ioX25aqXg-yWDA0oXBTATkFe+J25g-dB7-psS@mail.gmail.com...
> Hello,
>
> I am somewhat new to Git and I keep running into having to accomplish
> a certain task and reading through the documentation I can't seem to
> find any way of doing this easily.
>
> The problem is when branches diverge and I want to sync a branch to
> another branch with full overwrite, but maintain history and maintain
> separate branches.
>
> For example, say there is a branch "master" and I create a branch "b1"
> from master at some point. After this, there are 5 commits
> (C1,C2,C3,C4,C5) to master and
> 17 commits to b1 (let's call them cb1, cb2, cb3, ..., cb17). Say I
> want to create an 18-th commit to "b1" that makes it identical to the
> C5 (current) state of master. Essentially a single commit wipe of
> changes cb1 -> cb17 as well as application of C1->C5. So far I have
> found one way of accomplishing this, but it is difficult, error prone,
> slow and I just plain don't like it. I feel like there should be an
> easier way.
>
> What I currently do:
>
> $ rm -rf *
> $ git checkout -f master
> $ tar -cvzf /tmp/master.tar.gz *
> $ git checkout b1
> $ rm -rf *
> $ tar -xvzf /tmp/master.tar.gz
> $ git add
> $ git commit -a
> $ git merge master
>
>
> I've considered doing something like the following
>
> $ git checkout b1
> $ git revert b1~17..b1
> $ git merge master
>
> but it also seems wrong, and requires me to count the submits by hand,
> which seems silly --> I'm not actually reverting anything. I don't
> know if this would even work.
>
>
> Any suggestions on how to accomplish this easier? Some sort of a
> force-checkout that affects working tree only but not the index?
>
Have you looked at the vendor branch methodology in the git-rm manpage? It
may give you some ideas you're interested in.
v/r,
Neal
prev parent reply other threads:[~2010-12-14 14:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-13 23:30 Revert-style merge/Working tree-only checkout? Yuriy Romanenko
2010-12-14 5:46 ` Konstantin Khomoutov
2010-12-14 19:37 ` Andreas Schwab
2010-12-14 14:36 ` Neal Kreitzinger [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='ie7veg$ks5$1@dough.gmane.org' \
--to=neal@rsss.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).