[SOLVED] How to use .gitignore in IntelliJ

Answered
I'm new to IntelliJ Idea, why does IntelliJ not follow the .gitignore folder? I have run/saves/ in my .gitignore, but it's still showing up in the commit window. Is there an equivalent to .gitignore for IntelliJ?
 
0
3 comments

Please, note that when you add something to the .gitignore file, it will be excluded from Git only if it wasn't included before. In other words, if your file or directory was added to Git once, it won't work if you add them to the .gitignore.

To exclude it from Git version control, you need to perform the git rm command with the --cached option, for example:

git rm --cached <file_name>
 
or for directory:
 
git rm --cached -r <directory_name>
1

No the files weren't added to git. I figured it out though. I had to run ```git reset```

0

As I can see froma  screenshot you've had a few files with a green color name which indicates that they were added with git with `git add` command, but without a further commit, while `git reset` might have solved this issue by removing all local changes (such as `git add`)

0

Please sign in to leave a comment.