Sharing code via GitHub - What to put in .gitignore?


I’ve made my code for the Text101 project available here:

I’m learning git and GitHub - still trying to tweak my .gitignore file - I’d appreciate any feedback on what’s really useful or not in a GitHub repository for a Unity project. I started with Unity.gitignore from:

And I’ve added the TextMesh Pro subfolder that’s created in Assets to the .gitignore file. Anything else? Should ProjectSettings be ignored by git?

Hi CaptainQwyx,

This .gitignore is a good start and sufficient for “simple” Unity games. If you purchase assets which may not be made public, you could add them to the .gitignore. There is no definite answer because each project is unique and might need an individual .gitignore.

It seems that you made a commit of your completed project only. If you want to use git for your next project, make an initial commit with the .gitignore in it, and another commit with the empty, clean Unity project. Make a commit for each task you completed. That will make it easier for you to find file changes again, to undo changes and to retrieve data.

Since practice makes perfect, start with your project, use git. In many cases, you’ll figure out yourself what works best. :slight_smile:

Yeah, that’s my plan going forward. The projects I’ve already uploaded were already done by the time I started looking into git and GitHub.

Thanks for the response.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.