Omer Elkhalifa
Omer Elkhalifa

Reputation: 825

git add . add all the changes including the ignored flles

I change some files in the IDE, package name, and other files. and I need to commit these changes so I tried:

git add . --force

and it worked, but after that when I try to add some files to the staging area using just:

git add .

it will add all the files generated by the IDE "ignored files" when I try to push changes I notice that the commit size is too large!

Upvotes: 0

Views: 271

Answers (1)

phd
phd

Reputation: 94716

git add . --force added all files recursively including ignored; that's what --force is. Added files are tracked and no longer ignored; git only ignores untracked files.

To ignore the files you need to remove them from the repository using git rm --cached. Perhaps even from history using git rebase; but then you'll need git push --force.

Upvotes: 2

Related Questions