Search Feedback

67
votes

Do not create meta for empty directories to get rid of git conflicts

Collaborate

-

-

As said here
https://feedback.unity3d.com/suggestions/store-meta-file-for-a-folder-inside-the-folder

"At the moment meta files are stored like so:
Assets/MyFolder/
Assets/MyFolder.meta

On many occasions in client projects this has led to nonsense commits such as "Just re-committing a Unity generated meta file." for empty folders since git does not track empty folders."

The most common problem with that is that case:

Someone deletes directory with all the files and make a push.
Another one pulls and got an empty directory. Unity will create a meta for empty directory. Suppose, we have 10 people on the project - they will all have different metas generated. There will be a conflict if someone commits this file.

I'm facing that problem in 3 companies, I worked for recent 3 years, unity devs, please, pay attention to my straightforward suggestion to solve it.

There is a complex solutions to that, for example git hook: https://stackoverflow.com/a/19157675

I have a simple and straightforward suggestion: do not create meta for empty directories automatically. Create them only when there is any file inside. I see no reason to have meta for empty directory. There will be no problem, if meta will be generated only at the time any file is added.

Comments (2)

  1. 8f6aa0cc0f1d81a44e0b88916157e615?d=mm

    GeekyMonkey

    May 12, 2018 05:00

    Even if it doesn't create a conflict with differing id's within the meta, just the fact that the files disappear on one machine and re-appear on another is annoying and confusing for my students.

  2. 53b62659b53e3b6d66fdf0c827d0faf1?d=mm

    FeastSC2

    Apr 29, 2018 10:54

    This really should be a thing... It's a problem for us too.

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(11030)

2D

(290)

Ads

(63)

AI & Navigation

(83)

Analytics

(130)

Animation

(413)

Asset Store

(370)

Asset Store Publisher

(21)

Assets

(557)

Audio

(185)

Cloud Build

(154)

Collaborate

(70)

Docs & Tutorials

(251)

Editor

(2579)

Everyplay

(17)

Game Performance Reporting

(22)

General

(1003)

Graphics

(903)

GUI

(447)

Input

(173)

Licensing

(93)

Networking

(192)

Physics

(392)

Platforms

(448)

Profiling & Optimization

(84)

Runtime

(188)

Scripting

(1154)

Terrain

(177)

WebGL

(145)