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

前端 未结 9 2282
北荒
北荒 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:48

    Yes, git will track the changes in past content. It uses hashes of the file's content so regardless of where they are located in the directory structure, they will be the same file.

    As a result, you should do the move in one commit, and then fix up any edits in a subsequent commit. That will enable Git to determine the redirection with maximum efficiency, and won't make any difference to the amount of data stored in the repository (since you'd be making those changes anyway).

提交回复
热议问题