Git Delete Directory Syntax

According to the progit book, $ git rm log / \ *. log deletes all * .log files in the log directory. What is the meaning of the backslash "\" here? The book says that this is necessary because git extends its file name in addition to the shells shell name extension. could you indicate the meaning?

+4
source share
1 answer

This is not a git question, this is a sh(1) question.

The answer is that your shell expands the wildcard * by default, and the escape stops, so the git rm argument is log/*.log , not log/a.log log/b.log log/c.log .

The practical value is zero, unless you delete a log file that is not in the working tree.

+5
source

Source: https://habr.com/ru/post/1394504/


All Articles