Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move all of root into a subfolder

Tags:

git

In my git repo, the application is located in the root folder, like

.gitignore
pom.xml
data/
src/
README.md
...

due to a redesign of the application (one part is to introduce a parent pom), it i want to move everything into a subfolder, e.g. called system, and then create a second folder (e.g. called api):

system/
    .gitignore
    pom.xml
    data/
    src/
    README.md
    ...
api/
    src
    ...
...

What is the best way to move everything to system? Is git mv for each file/directory in the root directory enough?

like image 577
Indivon Avatar asked Nov 09 '22 20:11

Indivon


1 Answers

Simply move everything (except for the .git directory) into the new folder, run git add --all, and commit.

like image 179
David Deutsch Avatar answered Nov 15 '22 05:11

David Deutsch