I’m fairly new to the Github, Bitbucket… I recently lost all my files because i didn’t know these softwares and now i’m going on a hunt to have it working before I start over!
Anywho, I decided to use Bitbucket (SourceTree) and for some reason when I try to implement the .gitignore file in the unity assests folder Source Tree so it can ignore the Library. The text document does not convert into a GITIGNORE file type as I see in tutorials. Moreover, Source tree doesn’t recognize it…
Here is the code:
/[Ll]ibrary/
/
emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Visual Studio 2015 cache directory
/.vs/
# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
# Unity3D generated meta files
*.pidb.meta
# Unity3D Generated File On Crash Reports
sysinfo.txt
# Builds
*.apk
*.unitypackage
Any advice?
Thanks in advance!!
If you’re on windows, Windows Explorer probably complains when you try to remove the .txt, because it presumes all files should have an extension and and prefix and it sees .gitignore as a prefixless suffix.
What I do is use a editor like Notepad++, write my .gitignore, and then Save As directly from there.
If you’re on windows, Windows Explorer probably complains when you try to remove the .txt, because it presumes all files should have an extension and and prefix and it sees .gitignore as a prefixless suffix.
What I do is use a editor like Notepad++, write my .gitignore, and then Save As directly from there.
Remember Windows Explorer by default hides extensions… you may want to disable that feature to make 100% you have it named correctly.
For folks who stumble upon this thread later on: Another way of doing this would be to directly take the .gitignore file from GitHub (gitignore/Unity.gitignore at main · github/gitignore · GitHub)
It will contain a file named “Unity.gitignore” that you can rename to “.gitignore” in Window’s file explorer.
You then need to place it at the root of your Unity project.
Note that no matter which method you choose, if you already commited files that you now want to ignore, you need to tell Git to forget them. You can type git rm -r Library for example.