yuxuan
yuxuan

Reputation: 417

Add folder into existed git folder and make it become submodule

First, my question is different from Create a submodule repository from a folder and keep its git commit history .

Suppose I have git folder, let's say ~/GITA.
I want to move a folder ~/Folder1 into it. (~/GITA/Folder1).
Then in the folder (~/GITA/Folder1), change it into submodule.
And then push it (submodule ~/GITA/Folder1) to the new created server repository.

Upvotes: 0

Views: 51

Answers (1)

CodeWizard
CodeWizard

Reputation: 141956

You have to do it in a different way:

  1. Create a new repository and add the code from Folder1 to it.
  2. Now add this repository as submodule under the GITA project.

Now you should have 2 project in which the Folder1 is a submodule of the the GITAproject.

Upvotes: 1

Related Questions