Github and Unity. Unity gitignore not ignoring...

This is my .gitignore file looks like. The Gamexersice folder contains all the folders like .idea, Assets, Library, etc. I moved around the .gitignore file in different directories but still, my changed files contain like 1000.
It seems like assets and idea folders are not ignored. I am using a Github Desktop.
What my I doing wrong?

8199588--1069473--upload_2022-6-12_11-12-35.png

8199588--1069476--upload_2022-6-12_11-16-48.png

This .gitignore file should be placed at the root of your Unity project directory

Get latest from gitignore/Unity.gitignore at main · github/gitignore · GitHub

[Ll]ibrary/

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

# MemoryCaptures can get excessive in size.
# They also could contain extremely sensitive data
[Mm]emoryCaptures/

# Recordings can get excessive in size
[Rr]ecordings/

#Uncomment this line if you wish to ignore the asset store tools plugin
[Aa]ssets/AssetStoreTools*

# Autogenerated Jetbrains Rider plugin
[Aa]ssets/Plugins/Editor/JetBrains*

# Visual Studio cache directory
.vs/

# Gradle cache directory
.gradle/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb
*.mdb
*.opendb
*.VC.db

# Unity3D generated meta files
*.pidb.meta
*.pdb.meta
*.mdb.meta

# Unity3D generated file on crash reports
sysinfo.txt

# Builds
*.apk
*.aab
*.unitypackage
*.app

# Crashlytics generated file
crashlytics-build.properties

# Packed Addressables
[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin*

# Temporary auto-generated Android Assets
[Aa]ssets/[Ss]treamingAssets/aa.meta
[Aa]ssets/[Ss]treamingAssets/aa/*

8199588--1069470--upload_2022-6-12_11-12-23.png

1 Like

It looks like your git repo is one level higher than your project directory. I’m not positive that’s it, but all of my projects have the repository setup right inside the project folder and I’ve never had issues with git or gitignore.

1 Like

gitignore file should be in the gamexercise folder.

2 Likes