0

I've made a 2-module project where one module is completely denoted to a library that I've made and I'm accessing that library from the other module(which contains the MainActivity.java) of the project. Now I want to push only my library to the GitHub so that anyone can use it for their need. I know how to push the entire project to GitHub but How can I extract the library ( module ) from the project and push only that. Thanks in Advance!

Abhishek Kumar
  • 3,820
  • 5
  • 25
  • 44

2 Answers2

1

Based on my understanding, your root project is already versioned under git. If so then to version your library module as a separate git repo and also use it within other git repo projects, then you need to use git-submodule. The module will be pushed as a separate Android Project. Once that is done, you'll add the library to your app project by using git-submodule and configuring the settings.gradle to include the library module for compiling. And finally, add a dependency in your app build.gradle file to include the library in the app compilation.

ahasbini
  • 6,526
  • 1
  • 26
  • 43
0

This is so simple, maybe I misunderstand your need

git add <modulename.extension>
git commit -m "added single module"
git push origin master
3pitt
  • 769
  • 9
  • 21