Why .gitignore keeps including ignored folders?

This may not be the best place to ask this but I’m trying to use git source control. I’ve created a .gitignore file in my project folder and I want to ignore the Binaries/ Intermediate/ and Saved/ folders.

git add .gitignore
git commit -m "adding ignore list"
git push -u origin master

git add .
git commit -m "Initial Commit"
git push -u origin master

I cannot seem to start my repository without those folders and files being uploaded.

1 Like

Once files and folders have been added the gitignore is useless. You have to remove the files from staging and then it will reapect the git ignore.

HTH

2 Likes

Just an FYI, you ALWAYS want to set up your .gitignore and .gitattributes prior to pushing your project the first time.

I had a case where we added an ignore then ended up chasing this stupid file because someone forgot to delete it (also had a renaming issue, but that’s a DIFFERENT kettle of fish).

Sadly, you have to manually remove it from the repo. Do that a couple of times and you will make sure you set these files up ahead of time.