Getting Git to Acknowledge Previously Moved Files

前端 未结 6 1938
别跟我提以往
别跟我提以往 2020-12-01 01:25

I\'ve moved a bunch of files around manually without thinking, and can\'t find a way to get git to recognize that the files are just moved and not actually different files.

6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-01 01:36

    It happens to me, when I move and edit the file, it will no longer recognize it as moving file but a new one, so I lost history.

    What I do it is to create 2 separated commits, one when I move the file, and then another editing the file. In this way I keep the history.

提交回复
热议问题