git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Shantanu Pavgi <pavgi@uab.edu>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: bringing changes from one repo to other
Date: Thu, 30 Jun 2011 16:19:49 -0400	[thread overview]
Message-ID: <20110630201949.GA25850@sigill.intra.peff.net> (raw)
In-Reply-To: <F750768F-DC8E-435E-813A-C89AE9B9D89A@uab.edu>

On Thu, Jun 30, 2011 at 12:36:10PM -0500, Shantanu Pavgi wrote:

> I need to bring in changes from one git repository (say repo-A) to
> other(say repo-B) preferably preserving the commit history. The repo-A
> contains few initial bad-commit points - includes files that should
> have been ignored (e.g temporary files generated at runtime) and large
> number of files got committed in one go. Also, the repo-A and repo-B
> don't have any common commit point with common set of files. Is there
> any way to get commits from repo-A to repo-B? I tried git cherry-pick,
> but I am not able to preserve history after resolving conflicts.  Any
> comments or suggestions will be really helpful.

It sounds like you should use "git filter-branch" to edit the history in
repo-A into the shape you want (or even "git rebase -p -i" if the
history is simple and small), and then merge it into repo-B.

Note that this would mean throwing away the old repo-A history (which it
sounds like you want). If you want to include the full history, warts
and all, then simply merge repo-A into repo-B. Git doesn't have a
problem with merging histories with no common commits (though of course
you may get more conflicts, since there is no useful ancestor for a
3-way merge).

-Peff

      reply	other threads:[~2011-06-30 20:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-30 17:36 bringing changes from one repo to other Shantanu Pavgi
2011-06-30 20:19 ` Jeff King [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=20110630201949.GA25850@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=pavgi@uab.edu \
    /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).