Getting Git to Acknowledge Previously Moved Files

前端 未结 6 1937
别跟我提以往
别跟我提以往 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:42

    I think it already does this. Now, I could be wrong, but I've read that git tracks files based on their contents not based on their position in the file system or based on delta/differences. In the stack I think it shows it as if the files are being removed and the then re-added, but I think I've tried this once and it still maintained the history, due to the aforementioned way that git tracks things.

    Still would be helpful for someone to verify if I'm correct or not. Sorry if I misunderstood your question.

提交回复
热议问题