Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove file from Version Control in IntelliJ IDEA

I'm using IntelliJ IDEA Community Edition 2016.1. I've put my project under Git, hosted it on GitHub.

When I first hit that Share Project on GitHub button, every single file was selected to be put under version control.

Now I want to exclude the module IML file from version control. Obliviously, I want to keep it on my hard disk. Unfortunately, I cannot find a way to do this. How do I achieve this?

I tried to delete it from the web interface, but I'm getting some fatal errors while pulling/pushing.

like image 907
Atom 12 Avatar asked Mar 22 '16 19:03

Atom 12


1 Answers

There is a little trick.

  • Go to File Menu-> Settings | Version Control | Confirmation, then check the Show options before adding to version control setting under the When files are created section. Alternatively, you could check Do not add. It is mandatory that you do not check Add silently.
  • Delete the file you don't want to be tracked by VCS.
  • Press Ctrl + Z to undo the removal of the file. If IDE shows a popup window which lets you choose whether or not to add the new file to VCS, click No.
  • Commit your local changes, and the files are removed from VCS.
like image 56
XYz Amos Avatar answered Sep 19 '22 14:09

XYz Amos