0

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.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

That's a good thought, localA->remote->localB. So there are no direct way, such as git submodule init;git submodule remote add?
upi have to add init & update the submodule. 3 commands and that's it.
Excuse me, what's the meaning of "upi"? And you say 3 commands is about the former way (localA->remote->localB) or about the latter possible way (git submodule init;git submodule remote add). Thank you very much
Typo - should be you. sorry

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.