ディレクトリ内の 1 つのファイルを除くすべてのファイルを無視したい。
私はgit bashで次のことを行います。
$ mkdir dir_to_ignore
$ cd dir_to_ignore
$ vi file_to_ignore.txt
# (I put some content and save the file)
$ vi second_file.txt
# (Some text and then save the file. I dont wish this file to be ignored)
$ cd ..
$ vi .gitignore
次の内容を.gitignore
ファイルに入れました。
dir_to_ignore/
!dir_to_ignore/second_file.txt
しかし、今では、追跡されていないファイルとしてgit status
表示second_file.txt
されません。なぜこうなった?