Brian E. answered 08/25/19
Senior Full Stack JavaScript Developer (Node & React)
GitHub has predefined .gitignore files created for various technologies. Check out the one for unity: https://github.com/github/gitignore/blob/master/Unity.gitignore
Donna G.
asked 08/20/19What is the best way to access the GitIgnore file and what patterns should I use to ignore Unity build files?
Brian E. answered 08/25/19
Senior Full Stack JavaScript Developer (Node & React)
GitHub has predefined .gitignore files created for various technologies. Check out the one for unity: https://github.com/github/gitignore/blob/master/Unity.gitignore
Amanda O. answered 08/24/19
Computer Science teacher with industry experience
It looks like the way to add a .gitignore file in Github Desktop is to first create the file somewhere on your computer, then add it under 'Repository Settings'.
First, create a .gitignore file. I'd recommend creating the file in Notepad (Windows) or TextEdit in PlainText mode (Mac). The file name should be exactly .gitignore, not something.gitignore, or .gitignore.txt. There's a great Unity .gitignore template at https://github.com/github/gitignore/blob/master/Unity.gitignore. Save this file somewhere on your computer.
Assuming your Git repository sits at the root of the Unity project directory, you can use the template from that link exactly.
The next step depends on your GitHub Desktop version, but you should be able to do something like: click 'Repository', click 'Repository Settings', click 'Ignored Files', and then upload your .gitignore file and save.
Template (same as GitHub link above):
Good luck!
Joseph L. answered 19d
Coding, Game Dev, AI and Tech Solutions Professional
As mentioned in other answers, you will need a .gitignore file at the root of your repository. You can actually git ignore using the same filename in subdirectories of the repo as well but convention is usually just one at the root level that ignores filetypes and subdirectories from being tracked by git.
Files that start with a '.' character are buy-in-large treated as hidden files. You will also most likely need to show hidden files/folders in your explorer/finder windows depending on which OS you are running as well as if you are using git through a terminal, explorer window or GUI tool. Here are a couple of guides to show hidden files/folders in Mac and PC:
Mac - https://www.graphpad.com/support/faq/how-to-view-files-on-your-mac-that-are-normally-invisible
PC - https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/How-to-enable-hidden-files-and-folders-on-Windows.html
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Donna G.
Thank you! Very helpful!08/27/19