Skip to content

Update Unity.gitignore #4266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update Unity.gitignore #4266

wants to merge 1 commit into from

Conversation

AndiBird
Copy link

@AndiBird AndiBird commented Mar 22, 2023

I want to share with you those changes based on the experience with other contributor forums that have the same problem related to the problem with the current .gitignore template used with Unity. Also, I wish to improve the way to push commits in Unity with a little suggestion about .vsconfig file.

Fix problems with current Unity.gitignore:

Eliminated first slash from:

/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/

Because git keeps tracking those folders. But if you use:

[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
[Ll]ogs/
[Uu]ser[Ss]ettings/

Git won't track it.

.vsconfig file considerations:

Added line 29 and 30 because generation of a .vsconfig file is just to ensure Visual Studio installation is compatible. This is autogenerated when started Unity.

Reasons for making this change:

This modification in the template favors future projects as it helps to upload files to a repository in a cleaner way.
What I expect is to help improve the current standard for uploading a project to a repository.

Links to documentation supporting these rule changes:

https://learn.microsoft.com/en-us/visualstudio/gamedev/unity/change-log-visual-studio-tools-for-unity#4900 changelog 4.9.0.0 explains the function of .vsconfig file. It is not necessary to version it since it is autogenerated as explained in the following link:
https://docs.unity.cn/Packages/com.unity.ide.visualstudio@2.0/changelog/CHANGELOG.html (changelog [2.0.4] - 2020-10-15 explains that .vsconfig is just to ensure Visual Studio installation is compatible and it can be regenerated when using "regenerate all").

Is this a new template?: No, it is just a little modification of current Unity .gitignore.

Thanks for your attention.
Greetings.

-Added line 29 and 30 because generation of a .vsconfig file is just to ensure Visual Studio installation is compatible. This is autogenerated when started Unity.

-Eliminated first slash from:

/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/

Because git keeps tracking those folders. But if you use:

[Ll]ibrary/
[Tt]emp/
[Oo]bj/
[Bb]uild/
[Bb]uilds/
[Ll]ogs/
[Uu]ser[Ss]ettings/

Won't track it.
@salmonslay
Copy link

Library, Temp etc should be in the root of an Unity project, together with the gitignore file. If Git still tracks them, you're doing something wrong.

Copy link

github-actions bot commented Jun 8, 2025

This PR is stale because there have been no updates in 90 days. It will close after 180 days of inactivity. Leave a comment if you want to keep it open 😄

@github-actions github-actions bot added the stale label Jun 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants