Unity - new scripts aren't automatically added to git
Answered
Whenever I create a new script in Unity, the script is not added to git in Rider (file name is red and it doesn't show up in commits). This is not the usual new file behavior for a git repository and doesn't happen with other git GUIs like Sourcetree.
How can I get Rider to automatically add new files to the repo?
Please sign in to leave a comment.
Hello Sy ,
Please navigate to Settings | Version Control | Confirmation, set When files are created to Add silently and enable Apply to files created outside of JetBrains Rider. This will make Rider automatically add files created in Unity Editor to VCS
This setting is already set to “Add silently”.
Thank you for the clarification. What about the Apply to files created outside of JetBrains Rider setting, is it enabled?
Yes, it is. My settings are the same as the screenshot you posted.
Hi,
How do you add these files?
What does git status return (from terminal) when you add them? Are they recognized by git?
In Settings | Appearance & Behavior | System Settings, do you have “When switching to the IDE window or opening an editor tab" enabled?
For some reason, this is working now. I had added two files via right click -→ Create -→ C# Script and they were not automatically added to git. Now all new scripts I create are added. All that changed is that I updated the Rider Unity plugin.