我运行这个git add --force /dev/命令来将/dev设备添加到我的存储库中,我得到的git-status和以前一样。我单独添加文件夹中的每个文件,但得到相同的git-status。
这是我的测试,我得到了相同的结果,git可以跟踪块和字符设备吗?
yangchar@yangchar:~/verify$ git add ttyS0 --force
yangchar@yangchar:~/verify$ ll
-rw-r--r-- 1 yangchar yangchar 71 2012-11-28 10:59 hello.c
-rw-r--r-- 1 yangchar yangchar 0 2012-11-28 11:04 new.c
drwxr-xr-x 4 yangchar yangchar 4096 2012-11-28 11:15 ooxx/
-rw-r--r-- 1 yangchar yangchar 31 2012-11-28 10:47 README.md
crw-r----- 1 yangchar yangchar 4, 64 2012-11-28 16:05 ttyS0
yangchar@yangchar:~/verify$ git st
# On branch master
nothing to commit (working directory clean)发布于 2012-11-28 16:15:34
以下是来自git的dir.c的评论
/*
* Read a directory tree. We currently ignore anything but
* directories, regular files and symlinks. That's because git
* doesn't handle them at all yet. Maybe that will change some
* day.
*
* Also, we ignore the name ".git" (even if it is not a directory).
* That likely will not change.
*/Linux中的设备文件是一种特殊类型的文件,是什么使得它们的内容追踪非常困难(不可能?)。
https://stackoverflow.com/questions/13600498
复制相似问题