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

Surviving Git Submodules [Diagram]

DZone's Guide to

Surviving Git Submodules [Diagram]

Like so many other things, working with submodules in Git is so much easier when you know how.

· Integration Zone
Free Resource

Build APIs from SQL and NoSQL or Salesforce data sources in seconds. Read the Creating REST APIs white paper, brought to you in partnership with CA Technologies.

I'm a fan of submodules in Git, but sometimes it seems like I'm the only one! After having worked with this approach on a few projects, I'm coming to the conclusion that, like so many other things, it's easy when you know how. So, I tried to take my handwavy explanation of how to work with submodules and turn it into a handy diagram for you.

Surviving Submodules

The basic premise is this: remember that you need to commit to both the parent project and the submodule. Do the submodule first. You need to update the submodule when you update your main project. Stay away from git add . because it's alarmingly easy to revert submodule changes.

The Integration Zone is brought to you in partnership with CA Technologies.  Use CA Live API Creator to quickly create complete application backends, with secure APIs and robust application logic, in an easy to use interface.

Topics:
git ,submodules ,integration

Published at DZone with permission of Lorna Mitchell, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}