Ask Your Question

Revision history [back]

To add a submodule with JitPack, follow these steps:

  1. Navigate to your repository on GitHub and click the "Settings" tab.

  2. Scroll down to the "GitHub Pages" section and make sure the "Source" is set to "master branch /docs folder".

  3. Create a folder in your repository root directory called "submodules".

  4. Navigate to the "submodules" folder and create a new submodule by running the following command in your terminal:

    submodule add -b master https://github.com/<username>/<repository>.git

    Replace <username> and <repository> with the GitHub username and repository of the submodule you want to add.

  5. Commit and push the changes to your repository.

  6. Go to the JitPack website and enter your repository's URL.

  7. Click "Check" to verify that your repository has been added to JitPack.

  8. Go back to your repository on GitHub and create a new release.

  9. JitPack will automatically build and package your repository, including any submodules, whenever a new release is created.

  10. To use your submodule in another project, add the following dependency to your build.gradle or pom.xml file:

    'com.github.<username>:<repository>:<release-tag>'

    Replace <username>, <repository>, and <release-tag> with the appropriate values for your submodule.