Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Merging a Number of Git Projects Into One

DZone's Guide to

Merging a Number of Git Projects Into One

· Java Zone ·
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

The question of why and how git is so flexible is a really interesting one. Is it a consequence of its having been around for so long? Or that it was forged, as it were, at the hands of people who were doing real, large projects (e.g. Linux)? I have argued here before that after using Git for a very short amount of time, the idea of going back to subversion is ludicrous. The main reason for that is that you will develop facility with the tool very rapidly, which is really important: when you have a tool to use, you are either going to get your lashes burned off a few times, and will continue on, like someone who‘s stooping in a mudpuddle waiting for the next shelling to begin, or you will actually feel the inputs produce consistent outcomes. Git gets a 10 on this score.

Anyway, I got to the point where I wanted to change our current project, taking it from a bunch of disparate projects to one project with a bunch of subprojects. It‘s finally possible with m2 in eclipse. The problem was moving the code without losing history. A dude on StackOverflow had the answer. I made a shell script out of it that you can download here.

Git Documentation on Subtree Merges

 

From http://www.jroller.com/robwilliams/entry/merging_a_number_of_git

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}