Project settings ignored by .gitignore

I downloaded Unity 20.2 and want to use namespaces for my code. I set the value Assets for the settings which can be found here

=> Project Settings => Editor => C# Project Generation => Root namespace

The namespace settings work fine. But after checking the status of the version control I see that Git ignores those settings. I’m currently using this .gitignore file

    # OS
    Thumbs.db
    .DS_Store
  
    # Base
    [Ll]ibrary/
    [Tt]emp/
    [Oo]bj/
    [Bb]uild/
    [Bb]uilds/
    [Ll]ogs/
    [Mm]emoryCaptures/
  
    # IDEs
    **/bin/Debug
    **/bin/Release
    **/packages
    *.userprefs
    *.user
    test-results
    DerivedData
    xcuserdata
    ExportedObj/
    .consulo/
    *.unityproj
    *.suo
    *.tmp
    *.pidb
    *.booproj
    *.svd
    *.pdb
    *.mdb
    *.opendb
    *.VC.db
  
    # Jetbrains
    .idea
    [Aa]ssets/Plugins/Editor/JetBrains*
  
    # Visual Studio
    .vs
  
    # Visual Studio Code
    .vscode
  
    # Unity
    *.pidb.meta
    *.pdb.meta
    *.mdb.meta
    sysinfo.txt
    *.unitypackage
  
    # Unity autogenerated .csproj
    Assembly-CSharp*.csproj
  
    # Unity autogenerated .sln
    my-project.sln
  
    crashlytics-build.properties
  
    # Gradle
    .gradle
  
    # Builds
    *.apk
    *.aab
  
    # Temporary auto-generated Android Assets
    /[Aa]ssets/[Ss]treamingAssets/aa.meta
    /[Aa]ssets/[Ss]treamingAssets/aa/*

Does someone know which lines should be removed from the .gitignore when working with other people on a project?

I don’t think it is your .gitignore. Unity refuses to actually call fflush() on its project files to actually write your changes to disk when you change them, even though you cannot undo them. It is maddening.

I just tried it myself and it goes in this file:

ProjectSettings/EditorSetting.asset

and it is the entry m_ProjectGenerationRootNamespace:

Solution: save-project or save-scene should commit it to disk so you can commit it to source control.

Oh yeah, that helped. Thanks!

Are there any naming conventions for the root namespace. I think the correct one should be “Assets”, no? Or the name of my projeft?

I don’t even know what that is. In eight years of Unity-ing, I’ve never touched it. :slight_smile:

Hm yeah the problem is that when I create a new script inside Assets/Scripts the namespace is Assets and not Assets.Scripts

I started a new question here