2

I do have a similar problem with git and renaming to what has been asked regarding salesforce (here: Exclude certain file patterns from rename detection in git?) with certain files of Unity3D. Unfortunately, the above question has not gotten relevant answers over the years.

I would like to explicitly exclude certain files (in my case *.meta files) from rename detection when merging using git. As in the above linked question, changing the rename detection threshold will not help me because the meta files can be identical or at least very very similar.

I know how I can completely disable renaming detection, but this is not what I want because other files might really be renamed. Something like a ".gitignore" for rename detection is what I am looking for. Is there anything like this?

  • not familiar with Unity3D, but: why do you want to keep them out? If you add them to version control, and they **change** why don't you want to keep record of the change? Alternatively, if they are autogenerated and do not need to be versioned, why not ignoring them at all? – Daemon Painter Aug 14 '20 at 20:36
  • Thanks for the question. The files are autogenerated, but they record relevant information on certain settings inside unity ([afaik](https://docs.unity3d.com/Manual/ExternalVersionControlSystemSupport.html)). Thus I cannot ignore them. .... Regarding change: I do want to keep record of the changes, and actually I do, I just do not want them to be included in rename detection because the detected rename is often wrong ... usually *.meta files are simply not renamed. – Alexander Wiebel Aug 15 '20 at 13:11

1 Answers1

2

There is no such feature today (Git 2.28), but if you wanted to add one, that might be considered a good thing. I'd suggest starting a discussion on the Git mailing list. One possible method would be to list patterns in .gitattributes with attributes meaning "no rename source" and/or "no rename dest", perhaps.

torek
  • 448,244
  • 59
  • 642
  • 775
  • Thanks- Unfortunately this is what I assumed. I will wait shortly for maybe alternative answers and then mark this question as answered. – Alexander Wiebel Aug 15 '20 at 13:13