0

私はこの .gitignore ファイルを持っています:

# Ignore wordpress
/wordpress/
/wordpress/*

# Except the wp-content folder
!/wordpress/wp-content/
!/wordpress/wp-content/*

しかし、wp-content で何かを変更すると、その変更は git status にリストされません。

git add wordpress/wp-content

.gitignore contains /wordpress/ という警告がまだ表示されるため、変更を追加しません。どうしてこれなの?

追加

私はOSxでgit 1.7.3.2を実行しています

4

1 に答える 1

3

ディレクトリには追跡したいwordpressものがいくつかあるので、ディレクトリ自体を無視したいとは思いません。ディレクトリ内の最上位パスのほとんどwordpressを無視するだけで済みます。wordpress

これ.gitignoreで十分です。

# ignore most things in the wordpress directory
/wordpress/*

# ... except the wp-content directory
!/wordpress/wp-content/
于 2011-05-21T12:00:10.790 に答える