但这不在gitignore中

但这不在gitignore中

本文介绍了Git忽略.idea文件夹,但这不在gitignore中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:



我在OSX上。我有一个非常小的.gitignore文件,我甚至尝试彻底删除文件。没什么帮助。 Git在intellij的.idea目录下没有看到任何东西。



至少我想存储.idea / runConfigurations / *。更糟糕的是,根据, all 文件在那个目录,但1或2应该是源代码控制。



是否有一个额外的,隐藏的.gitignore设置,我不知道的地方?有什么方法可以搜索并杀死它?如果是这样的话?



到目前为止采取的步骤:



我手动添加了最重要的:

  

c $ c>档案? 是可能有用的信息。



Git有一个非常灵活的忽略文件层次结构:首先它读取主目录中的 .gitignore 文件。把所有回购的共同数据放在这里( *。bak ,例如,你在任何回购中绝对不需要它们)。然后,您可以在您的仓库中的任何文件夹中拥有 .gitignore 文件。它会影响此文件夹及其子目录中的任何文件。此外,您可以在 .git / info / exclude 中排除。它与 .gitignore 不同,因为它没有编入索引,您可以在此处设置个人设置。当然〜/ .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

解决方案

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.

这篇关于Git忽略.idea文件夹,但这不在gitignore中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 05:44