Answer the question
In order to leave comments, you need to log in
How to move a Git repository up a level, including new folders?
Hello!
There is a project structure:
Answer the question
In order to leave comments, you need to log in
Create another dir3 inside dir3, move everything except git there, rename the original dir3 -> dir1, place the files a level higher in the renamed dir3 in dir1.
Everything works, I note that copying should be done as follows:
create a new directory (adding a dot to the beginning of its name so as not to get errors in the next step):
$ mkdir .dir3
move all the contents of the current directory to this directory:
$ git mv * .dir3
rename the directory, removing the first character - the dot - from its name:
$ git mv .dir3 dir3
check if everything is correct:
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD ..." to unstage)
#
# renamed: dir/index.html -> docroot/dir/index.html
# renamed: index.html -> docroot/index.html
#
do a git commit
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question