Hide nested git repo to outer repo

I have two clojure projects, A and B. Both of them are git repos. Project B is used as a packaged dependency in project A (a .jar).

To test and work on project B I need to use it in project A. So I clone B's repo inside A's root folder, and change the resolution path from the package (.jar) path to the new code path. When I'm finished, I move to B and from there I commit and push. So commits are made to B, and A is left intact.

The reason I don't use submodules is that I don't need A keeping any track of changes in B. The only reason B is nested in A, is for my resolution engine (shadow-cljs) to find it. The same way that the packaged dependency is inside A's root. I understand that is the most common thing to have dependencies inside projects, unless they are global.

To avoid A's repo considering B a submodule I added B to .gitignore before I cloned it. However, git seems to create a submodule commit. I removed it with git rm --cached and committed, but as soon as I change branches, make changes or do some git stuff, it creates it so I have to remove it again.

I am using vscode, which recognizes both repos in the git panel, but doesn't show in any way that B is a submodule of A. Anyway, I have disabled the git.detectSubmodules config.

I`ve seen the update in this answer but it doesn't go into much detail. Also, it could be a problem with vscode, but I couldn't find anything about that.

Upvotes: 0

Views: 50

Answers (0)

Related Questions