Ignoring folder meta files on version control

后端 未结 3 1194
不知归路
不知归路 2021-01-30 12:13

Unity creates and deletes meta files for folders inside the Asset folder.

That can create an annoying situation when using version control (that you can skip an

3条回答
  •  孤街浪徒
    2021-01-30 12:53

    to include meta files along with assets, simply add the following after your exclusions:

    !*.*.meta
    

    Here is a sample of my .gitignore:

    # Ignore the following files
    # --------------------------
    # Unity3D specific
    #
    **/Library/*
    **/Temp/*
    **/*.csproj
    **/*.unityproj
    **/*.sln
    **/*.userprefs
    **/*.pidb
    
    # include meta files
    !*.*.meta
    

    I place this at the folder with the git repository structure, so my project structure would look similar to:

    root folder /
       - Unity Project/
            - .gitignore
            - .git/
            - ProjectFolder/
                  - {all project related data}
    

    hope that helps.

提交回复
热议问题