I was trying out some sample instructions of git and came across this peculiar case that when we do a git rm *
, it doesn't delete the .*
files in the first attempt.
Why is it so?
mkdir -p test_repo1/folder && cd test_repo1
touch .testfile1 .testfile2 testfile3 folder/testfile4 folder/.testfile5
git init && git add . && git commit -m "test commit"
If now I do a git rm
as follows, I have to do it a second time to remove all the files
$ git rm -r *
rm 'folder/.testfile5'
rm 'folder/testfile4'
rm 'testfile3'
$ git rm -r *
rm '.testfile1'
rm '.testfile2'
Why doesn't git remove all files in the first attempt itself? Also, why is this happening for files withing the repo root only?
Interestingly, if all I have are those .testfiles
, then git removes them in the first attempt itself.
I am using git version 1.7.9.5
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…