Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
783 views
in Technique[技术] by (71.8m points)

macos - Git is ignoring .idea folder, but that isn't in gitignore

The problem:

I'm on OSX. I have a very small .gitignore file, and I even tried completely deleting the file. Nothing helps. Git doesn't see anything under my .idea directory for intellij.

At the very least I want to store .idea/runConfigurations/*. Worse than that, according to this post, all the files in that directory but 1 or 2 should be source controlled.

Is there an extra, hidden .gitignore setting somewhere I don't know about? Is there any way to search for and murder it if so?

Steps taken so far:

I manually added the most important ones with:

git add .idea/runConfigurations -f

Trying that without the -f gave:

The following paths are ignored by one of your .gitignore files:
.idea
Use -f if you really want to add them.

To reiterate: it gave that error even when I completely deleted my .gitignore file

Similar-but-unsolved thread:

After raking through SO I managed to find one other thread having the same problem. Unfortunately it got marked as answered even though the original poster replied that the problem remained unsolved. Regardless, MY version of the problem remains unsolved

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Do you have ~/.gitignore file? Here is the information that may be helpful.

Git has a very flexible hierarchy of ignore files: First it reads .gitignore file in your home directory. Put here common data for all repos (*.bak, for example, you definitely do not need them in any repo). Then, you can have .gitignore file in any folder inside your repo. It impacts on any files in this folder and its subdirectories. Also, you can have excludes in .git/info/exclude. It differs from .gitignore because it is not indexed, and you can put personal settings here. Of course ~/.gitignore is not indexed too.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...