I run this git add --force /dev/ cmd to add /dev devices to my repo,I get the same git-status as before. I add each file in the folder independently, but I get the same git-status.
here is my test,i get the same result,can git track block and char devices ?
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)
No, you can not add device file to git repository. Here is a comment from git’s dir.c:
Device files in Linux are special kind of file, what makes their content track very hard (impossible?).