6

gitリポジトリにMakefileを含めようとしていますが、次のメッセージが表示されます。

$ git add Makefile
The following paths are ignored by one of your .gitignore files:
Makefile
Use -f if you really want to add them.
fatal: no files added

私のリポジトリ.gitignoreファイルには次のものがあります。

*.pdf

私の〜/ .gitignore_global

#-*-shell-script-*-

# Python
*.pyc

# Latex
*.aux
*.bbl
*.blg
*.log

build

# Mac
*~
.DS_Store

私の.gitignore_globalはgitconfigにあります:

$ git config -l
core.excludesfile=/Users/marcos/.gitignore_global

私のリポジトリは別のリポジトリ内にありません。GitがMakefileを無視するのはなぜですか?

4

1 に答える 1

4

gitignoreマニュアルの引用(私の強調):

gitignoreファイルの各行はパターンを指定します。パスを無視するかどうかを決定するとき、gitは通常、複数のソースからのgitignoreパターンを、最高から最低の順に次の優先順位でチェックします(1レベルの優先順位内で、最後に一致するパターンが結果を決定します)。

(...)

  • $ GIT_DIR / info/excludeから読み取られたパターン。

したがって、の内容を確認する必要があり.git/info/excludeます。

于 2012-11-23T13:41:28.143 に答える