I have a project that uses modules. One of the modules that I need to use is inside another repository. In the future, I will connect that module into my project using mavenCentral
, but not now.
I want to have my MODULE from another repository inside my PROJECT without adding the MODULE into my PROJECT GIT. And I should be able to switch between git repos and commit the changes into their corresponding repositories.
So far I did this:
-- added MODULE origin inside PROJECT like so.
git remote add MODULE [module URL in Github]
git fetch MODULE
after the above steps, when I do git remote -v
it is displaying two remotes. One for PROJECT (origin) and one for MODULE.
After these steps, I am not sure what to do next in order to achieve my objective. Is it even possible?
I tried git merge MODULE/master --allow-unrelated-histories
but it is adding my MODULE code into my PROJECT which I don't want.
Could someone point me in the right direction? Thanks.