Sometimes, I commit files I don't want.This reminder explain how to remove theses files from GIT.
First, you can list files managed by your GIT repositories :
git rm --cached .idea
Then, you have to delete unwanted files.In my case, I commited the .idea directory :
rm '.idea/.gitignore'
rm '.idea/misc.xml'
rm '.idea/modules.xml'
rm '.idea/php.xml'
rm '.idea/vcs.xml'
rm '.idea/yuzu.iml'
If you check the status, you are going to see delete files :
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: .idea/$CACHE_FILE$
deleted: .idea/.gitignore
deleted: .idea/misc.xml
deleted: .idea/modules.xml
deleted: .idea/php.xml
deleted: .idea/vcs.xml
deleted: .idea/yuzu.iml
You only have to execute the commit command : git commit -m "Delete unwanted files"
The last step is to add the unwanted files or directory in the .gitignore file (.idea in my case) :
.idea
GIT : version 2.17.0.windows.1