According to progit book, $ git rm log/\*.log removes all *.log files in log directory. What is the meaning of the backslash “\” here ? The book says this is necessary because git does its own filename expansion in addition to the shell’s filename expansion. could you please specify the meaning ?
Share
That isn’t a git question, it is a
sh(1)question.The answer is that your shell will expand the wildcard
*by default, and the escape stops that happening, so that the argument togit rmislog/*.lograther thanlog/a.log log/b.log log/c.logall spelled out.The practical significance is zero, unless you are removing a logfile that isn’t in the working tree, though.