My Git repository is in the wrong root directory. Can I move it? (../ instead of ./)

I had the opposite problem – had to shift the git root to the parent directory (from project/src to project)
To my extreme surprise, the following worked!!

src$ mv .git ../ 
src$ cd ..
project$ git add src
project$ git commit -a

git cleverly detected that all the new files were renamed versions of old ones and no history was lost

You can try something similar… move the .git folder and add the files again before committing

Leave a Comment