How can I move all git content one-level up in the folder hierarchy? How can I move all git content one-level up in the folder hierarchy? git git

How can I move all git content one-level up in the folder hierarchy?


The right way to do this is:

git mv repo.git/webapp/* repo.git/.git rm repo.git/webappgit add * git commit -m "Folders moved out of webapp directory :-)"


Another variant of Sumeet's answer - in the repository directory above "webapp" execute following command:

git mv webapp/* ./ -k

-k - Skip move or rename actions which would lead to an error condition, otherwise you get:

fatal: not under version control, source=webapp/somefile, destination=somefile


I was able to get it to work simply by doing this from the destination folder:

git mv webapp/* .

It seems this doesn't work in the Windows shell (fails with an error Bad source), but it will work in Windows if you use the Git Bash shell, which expands the * wildcard.