DEV Community

Discussion on: Git file renaming issues (deleting/adding instead of renaming)

Collapse
 
jessekphillips profile image
Jesse Phillips

Git has no rename, just like in Linux. Git facilities a rename through heuristics of a delete and add in the same commit. The file can be modify on the other end, but if it differs to much it will consider it a new file.

Collapse
 
jessekphillips profile image
Jesse Phillips

See, history does know it is the same, github.com/sindresorhus/refined-gi...

But it seems the review tool or the git diff command used is recalculating the heuristics, which makes sense because git prefer to ignore individual Commits when diffing

Collapse
 
nickytonline profile image
Nick Taylor

Yeah I see that in the history. But the next commit changes the content and that's when it thinks it's an add/delete. That's what's confusing me. So as you say, it is keeping the history, it's just the diffing tool confusing me.