1
我想忽略除git系統中的* .c文件以外的任何文件。我這樣寫了.gitignore
文件。如何用gitignore忽略子目錄文件?
!**/*.c
雖然我的文件不會被忽略。
~/p/normal_linux_programming (master) $ git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: .gitignore
new file: bell/a.out
new file: bell/bell.c
new file: bell/bell.c~
new file: cat/#cat.c#
new file: cat/a.out
new file: cat/cat
new file: cat/cat.c~
new file: cat/cat2
new file: cat/cat2.c~
new file: cat/data
new file: cat/data~
new file: chmod/chmod
new file: chmod/chmod.c
new file: chmod/chmod.c~
new file: chmod/unko
new file: grep/a.out
new file: grep/grep
new file: grep/grep.c~
new file: head/#head.c#
new file: head/.#head.c
new file: head/head
new file: head/head.c~
new file: hello/hello
new file: hello/hello.c
new file: hello/hello.c~
new file: ln/ln
new file: ln/ln.c
new file: ln/ln.c~
new file: ls/ls
new file: ls/ls.c
new file: ls/ls.c~
new file: mkdir/mkdir
new file: mkdir/mkdir.c
new file: mkdir/mkdir.c~
new file: mv/#mv.c#
new file: mv/.#mv.c
new file: mv/NOTJUNK
new file: mv/mv
new file: mv/mv.c
new file: rm/rm
new file: rm/rm.c
new file: rmdir/rmdir
new file: rmdir/rmdir.c
new file: rmdir/rmdir.c~
new file: stat/stat
new file: stat/stat.c
new file: stat/stat.c~
new file: symlink/symlink
new file: symlink/symlink.c
new file: symlink/symlink.c~
new file: tail/#tail.c#
new file: tail/.#tail.c
new file: tail/tail
new file: tail/tail.c~
new file: wcl/a.out
new file: wcl/wcl
new file: wcl/wcl.c~
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
我該怎麼做?
我只想歸檔* .c源文件。