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

前端 未结 9 2256
北荒
北荒 2020-11-30 22:09

I have a git repository whose structure looks like:

+--repo.git
|
+----+bootstrap.py
+----+buildout.cfg
+----+.gitignore
+----+webapp
|
+---------+manage.py
         


        
9条回答
  •  失恋的感觉
    2020-11-30 22:53

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

    git mv webapp/* ./ -k
    

    -k - includes files which are yet not under version control, otherwise you get:

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

提交回复
热议问题