Preferences > Version Control > Ignored Files seems to have no effect on git?

已回答

Hello all,

I've set up git (github) and added files to the Ignored Files list, but when I run git status, they are still picked up.

I had to manually put a .gitignore file into the project root (and list the files there) for git status to show them correctly.

How can I make git pick up on what I set in IntelliJ's preferences (re ignored files)?

If I add files to that list and use the built-in commands (and not Console), will git ignore the files I added to the Ignored Files list?

I don't under any circumstances want to commit certain files into the repo, so they must go into the ignore list...

Cheers,

Christian

0

Ignored files is the internal IDE setting. It tells IDE to ignore them, not git.

So it is expected that git status command shows the files listed there because git has no idea about Ignored files list inside the IDE.

On the other hand, IDE supports .gitnigore, so just add all files you want to ignore to the relevant gitinore file, and IDE won't commit them.

Please note, that it is only possible to ignore files that are not tracked by git (unversioned).

 

There is a request to sync the Ignored files list and gitingore - https://youtrack.jetbrains.com/issue/IDEA-60354

0

请先登录再写评论。