私は走った:
$ for number in $(seq 1 9); do mkdir -p Thing$number.Thing/bin; done
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: makefile
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# b+tree
# b+tree.cpp
# cswap.c
# qs.c
# qs2.c
# qs3.c
# select.c
# shm
# shm.c
# sleepers-awake.c
no changes added to commit (use "git add" and/or "git commit -a")
$
ディレクトリにはコンテンツがなく、git
追跡するものがないため、追跡する必要があるものとしてリストされていません。ディレクトリにファイルを追加しました:
$ for d in Thing?.Thing/bin; do cp qs.c $d; done
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: makefile
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# Thing1.Thing/
# Thing2.Thing/
# Thing3.Thing/
# Thing4.Thing/
# Thing5.Thing/
# Thing6.Thing/
# Thing7.Thing/
# Thing8.Thing/
# Thing9.Thing/
# b+tree
# b+tree.cpp
# cswap.c
# qs.c
# qs2.c
# qs3.c
# select.c
# shm
# shm.c
# sleepers-awake.c
no changes added to commit (use "git add" and/or "git commit -a")
$
git
追加が必要なディレクトリが表示されるようになりました。私は次のように編集.gitignore
して追加しましたThing*.Thing/bin
:
Thing*.Thing/bin
*.a
*.dSYM
*.o
*.so
*~
a.out
core
posixver.h
timer.h
私は再実行しましたgit status
:
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .gitignore
# modified: makefile
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# b+tree
# b+tree.cpp
# cswap.c
# qs.c
# qs2.c
# qs3.c
# select.c
# shm
# shm.c
# sleepers-awake.c
no changes added to commit (use "git add" and/or "git commit -a")
$
したがって、正規表現 (グロブ?) を機能させることができます。*/bin
また、 inを使用してテストを再実行しました (最初のテストをクリーンアップした後) .gitignore
。同じ結果 — パターンが機能し、ディレクトリが抑制されました。
git --version
レポートを使用して Mac OS X 10.9 (Mavericks) でテスト済み1.8.3.4 (Apple Git-47)
。