0

当我做一个 git status 这就是我得到的

# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   .idea/

这个.idea/ 文件夹来自 IntelliJ 和 RubyMine,但我不希望它被添加到我的 Git 中。当我说git add . 我仍然希望能够做到这一点但不包括 .ida/ 文件夹时。

实现这一目标的正确 git 命令是什么?

4

2 回答 2

3

.idea

以及您想在存储库中调用的文件中忽略的任何其他路径.gitignore(并使用 Git 跟踪)。详情请参阅gitignore(5)

于 2013-02-11T14:15:18.533 回答
3

.gitconfig添加或.git/info/exclude添加以下内容:

.idea/

前者可以提交并成为存储库的一部分。后者更适合不应影响其他用户的按用户设置。

于 2013-02-11T14:15:36.710 回答