Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git submodule

Git submodule

Oursky Limited

December 15, 2014
Tweet

More Decks by Oursky Limited

Other Decks in Programming

Transcript

  1. Situation • I want to do a Swipe menu on

    Android • I find a repos do what I want at Github • But the repos don’t publish on maven (or other hosted package management platform) • Or want to use a specific fork/commit
  2. One of the solution • Copy the project into libs

    or SupportProjects • Copy the jar
  3. Pros and cons • git clone and go • Accessible

    and can easily modify the plugins • Mixed up lib and App code • Difficult to update the library
  4. Use git submodule • Smaller main repos • Maintain the

    reusability of the module • Separation of concern, Application vs module • Contribute back of Open Source project • Upgrade of module become easy
  5. Actual usage • git clone [email protected]:oursky/project.git • Add • git

    submodule add Path [email protected]:oursky/module.git • Checkout • git submodule update --init --recursive