Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add subproject as usual folder to repository

I noticed that in my directory there were two modules that had been Subprojects of my Git repository. That happened because I moved them all to one Git repo and those modules (directories) had their own .git directory.

When I changed anything in those modules I would not see any changes in my main Git repository. I would see only this:

+Subproject commit e97ff0348e6adc697192ca4e6a367bdaeddcda6b-dirty

etc.

But I don't need that. I only need one Git repository without any subprojects. So I deleted .git directories inside those subprojects. And now I don't see any changes at all on my main repository.

I tried add * and git init. But it just does not see those directories even though it is inside repository. How can I make Git see those directories, so it would track their changes like other modules?

My Git repository looks something like this:

my_project/
 .git
 dir1
 dir2
 dir3 # Let's say this is the one directory that Git does not see. So any changes I make here are not tracked at all.
 ...
 ...

P.S. Those directories that are not tracked are not empty.

Update If I rename that directory, then doing this: git diff

I get this:

diff --git a/dir3 b/dir3
deleted file mode 160000
index e279fc4..0000000
--- a/dir3
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit e279fc481b9706ad79b24281efdbabd55179aee8

If I rename that directory back to original name, then doing git diff, returns nothing or just that there were no changes done.

like image 701
Andrius Avatar asked Dec 10 '14 14:12

Andrius


1 Answers

After suggestion I looked at this: un-submodule a git submodule

First tried:

git submodule deinit

After this it didn't change the old behavior. But when I did this:

git rm --cached yourSubmodule

Then it removed it as submodule and git started seeing those modules in main repository.

like image 66
Andrius Avatar answered Oct 14 '22 13:10

Andrius