2

I have a project with gitignore file:

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
Temp*
RationalValues*

https://github.com/hhlTer/quadraticEquation

but .idea directory still pushed in my repository...why?

This makes coding very difficult and inaccessible in branches.


I did add to gitignore all files from .idea, but all files still in repository

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
Temp*
RationalValues*
compiler.xml
encodings.xml
misc.xml
uiDesigner.xml
vcs.xml
workspace.xml
Valentyn Hruzytskyi
  • 1,772
  • 5
  • 27
  • 59

3 Answers3

5

If they are being pushed, it means they were added at some point to your git.

To ignore them, you must remove them from your repository first, commit the changes and then they won't be added again, as they are on the .gitignore.

To remove the files from git without deleting them, you can do: git rm -r --cached .idea

Please, find more about here: http://www.codeblocq.com/2016/01/Untrack-files-already-added-to-git-repository-based-on-gitignore/

Gustavo Lopes
  • 3,794
  • 4
  • 17
  • 57
5

.gitignore will only make git ignore files in your local repository, and will not apply to files already pushed to the remote repo.

If you wish to remove the files from the remote repository, you can use git rm --cached -r .idea

Please also see this answer

Good luck! :-)

Søren Falch
  • 111
  • 4
0

You may had a "/" character after each directory reference. To ignore .idea directory, you have to write

.idea/

BartmanDilaw
  • 398
  • 4
  • 15