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
As user1281385 noted in a comment, the shell expands *
the first time around.
The reason the second time removes the dot-files is that once there are no files to match, the shell leaves the literal asterisk as an argument (depending on your shell anyway, at least one variant errors out instead) and git then does its own matching.