V
V
vacoo2015-11-01 07:27:10
git
vacoo, 2015-11-01 07:27:10

How to make git not see .idea?

I'm starting to use git at work. I liked it very much. But I can't handle one problem:
PHPStorm has an .idea folder where the editor saves configurations. With any operation, the values ​​\u200b\u200bthere change, and git takes all this into account, which is terribly disturbing. Especially when merging branches.
Added to .gitignore:
.idea/*
But it doesn't help. How to make git forget that this folder even exists. I've been suffering for 3 days now.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Kotik Anton, 2015-11-01
@vacoo

First, remove the folder from git: git rm -r --cached .idea
The .gitignore should just be .idea/without the asterisk. Example . By the way, there is a plugin
for .gitignore in PhpStorm . If you do as Nazar Mokrinsky advised , then the files will be ignored only when working with git through PhpStorm, which, in general, is a serious limitation. Then it's better to use .git/info/exclude, but all these ways to opt out of gitignore are, let's say, not popular .

N
Nazar Mokrinsky, 2015-11-01
@nazarpc

The .idea folder is your local environment, it should not be mentioned in the repository, you do not need to put it in .gitignore.
Here's what to do:
d4cbe31f7e4147a8ab3ae319c639fb93.pngedaf451152dd4a79b82e9d394b0da31f.png

I
ifqthenp, 2015-11-01
@ifqthenp

My .gitignore looks like this:

# IntellijIdea files
*.iml
.idea
out

Everything is perfectly ignored, the wand is not needed at the back.

I
ivanitch, 2021-05-15
@amurcoder

Like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question