Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] How to merge (subsets of) 2 git repos into 1, preserving history ?

Thanks Mickael,

 

Your solution looks simple and compelling, but I’m afraid it would merge the _entire_ two repositories.

 

We only want the terminal/ and terminals/ subtrees respectively, with any history for stuff outside those trees pruned away …

 

Thanks for the hints so far, I’d appreciate more tips on the restructuring bug to avoid spamming cross-project J

https://bugs.eclipse.org/bugs/show_bug.cgi?id=462230

 

Thanks,

Martin

--

Martin Oberhuber, SMTS / Product Owner – Development Tools, Wind River

direct +43.662.457915.85  fax +43.662.457915.6

 

From: cross-project-issues-dev-bounces@xxxxxxxxxxx [mailto:cross-project-issues-dev-bounces@xxxxxxxxxxx] On Behalf Of Mickael Istria
Sent: Thursday, April 09, 2015 11:36 AM
To: cross-project-issues-dev@xxxxxxxxxxx
Subject: Re: [cross-project-issues-dev] How to merge (subsets of) 2 git repos into 1, preserving history ?

 

On 04/09/2015 11:14 AM, Oberhuber, Martin wrote:

Hi all,

Hi, 

1.      Create a new git repo under /gitroot/tm/org.eclipse.tm.terminal.git

2.      Fill it with the following subtrees from 2 other git repos, including all history in those subtrees respectively:

a.       http://git.eclipse.org/c/tm/org.eclipse.tm.git/tree/terminal

b.      http://git.eclipse.org/c/tcf/org.eclipse.tcf.git/tree/terminals

Unfortunately, those repositories seem to have colliding content (pom.xml, .project... filed under the same relative location). This will require actual conflict resolution.
Do you also need to keep all branches/tags, or just merging master branches with history is enough?
If the later:
  $ cd org.eclipse.tm.terminal/
  $ git remote add tcf git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.git
  $ git remote add tm git://git.eclipse.org/gitroot/tm/org.eclipse.tm.git
  $ git fetch tcf master
  $ git merge FETCH_HEAD
  $ git fetch tm master
  $ git merge FETCH_HEAD
// Have fun with actual merging of files, that's where most of the work is. Apparently, there are "only" 8 files to merge, some of them being trivial, so it may be only 1 hour of work.
  $ git add admin/target-defs/*.target admin/* .gitignore
  $ git commit -m "Merge TM and TCF"
  $ git push origin HEAD:master

HTH

--
Mickael Istria
Eclipse developer at JBoss, by Red Hat
My blog - My Tweets


Back to the top