Reputation:
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.
Upvotes: 50
Views: 67961
Reputation: 2603
for subversion:
open terminal use "svn rm --keep-local" to remove
svn rm --keep-local /aa/bb/cc/myfile.txt
Upvotes: 2
Reputation: 1493
There is a little trick.
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
.No
.Upvotes: 80
Reputation: 141946
Once you commit the file it will begin to be tracked.
In order to remove the file from this point you have to remove them from the repository.
What you need to do now is to delete the entire .idea
folder, commit the deletion, add the idea
extension to your .gitignore
file.
Explaining how to do from command line, can be done via IDEA as well.
# Remove the file from the repository
git rm --cached .idea/
# now update your gitignore file to ignore this folder
echo '.idea' >> .gitignore
# add the .gitignore file
git add .gitignore
git commit -m "Removed .idea files"
git push origin <branch>
Upvotes: 35