How can I untrack a file from a git repository in Intellij How can I untrack a file from a git repository in Intellij git git

How can I untrack a file from a git repository in Intellij


As of 2017.3.4, you cannot use the IDEA GUI to perform this command, it must be done from the command line or another tool.

From console:

git rm --cached filegit commit -m'file removed'echo 'file' >> .gitignore


IntelliJ doesn't allow you to untrack added files, but you quit easily can get to the same result as follows:

  1. In IntelliJ open the Version Control Tool Window
  2. In the Local Changes tab: create a new change list (do NOT make it active)
  3. You can add all the files you would not want to commit to this new changelist.
  4. Commit and push only the other changelist(s)

Like so you don't have to botter about (not) adding files. You can add all files and drag 'm into the new changelist if you don't want to commit these files.

Be aware though, when also using git cli, the files are still added to the working directory and will be taken into account when committing. Use the other answers on this page.


in WebStorm 2018.2.1 you can do it like this:in version control tab right click unversioned files and ignore file