N
N
nckma2015-02-25 15:08:47
git
nckma, 2015-02-25 15:08:47

How to make a git submodule just a project folder?

There is a project which is stored in GIT.
The project uses several submodules.
myproject
+--dir1
+--dir2
+--dir3 (as git submodule)
+--dir4 (as git submodule)
+--dir5
... You want
to get rid of the submodule, but the dir3 and dir4 folders should remain in the project.
It is required to save the entire history of submodule commits.
How?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
evnuh, 2015-02-25
@evnuh

Delete the submodule, leaving the folder itself:

git submodule deinit dir3
git rm --cached dir3
rm -rf .git/modules/dir3

Next, add this folder to the index of the current repository:
ps something like this, I did not test it :)

V
Victor, 2015-02-25
@v_decadence

I won’t tell you the exact instructions, but you need to look towards git subtree

C
CycaHuH, 2015-02-25
@CycaHuH

More or less like this:

git remote add <name> <submodule_url>
git fetch <name>
git merge -s subtree <name>/<branch>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question