All of lore.kernel.org
 help / color / mirror / Atom feed
* Merging back from master but keeping a subtree
@ 2011-09-17  7:49 Steinar Bang
  2011-09-18  3:37 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Steinar Bang @ 2011-09-17  7:49 UTC (permalink / raw)
  To: git

I have a long lived branch that changes a directory and its
subdirectory, ie. 
 top/middle/mydirectory

Now I want to merge in an updated remoterepo/master and keep everything
from that master, except for mydirectory and its subdirectory, where I
would like to keep everything from my branch.

I tried a regular merge, and used
 git checkout --ours
 git add
and 
 git checkout --theirs
 git add
as appropriate on all conflicts.

But the result didn't build, and the build errors don't make much sense,
so I think they are caused by "successful" merges giving bad results.

Is there a better way to do this?

Would it be possible to unstage the already staged files and apply the
"checkout --ours" and "checkout --theirs", and then git add on the
checked out files?

Even that would be clumsy... I would have preferred something like
 git checkout --theirs top
 git checkout --ours top/middle/mydirectory
 git add-only-those-modified-wrt-my-branch


Thanks!

- Steinar

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-16 13:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-17  7:49 Merging back from master but keeping a subtree Steinar Bang
2011-09-18  3:37 ` Jeff King
2011-11-16 13:39   ` Steinar Bang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.