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

Try Okta to add social login, MFA, and OpenID Connect support to your Java app in minutes. Create a free developer account today and never build auth again.

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

Build and launch faster with Okta’s user management API. Register today for the free forever developer edition!

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}