开发者

What does recursive mean in relation to the git rm -r [filename]

I am working through some tutorials for git and don't understand the difference between running

git rm [path/to/file]

and

git rm -r [path/to/file]

What exactly 开发者_如何学编程does the recursive mean?

Thanks in advance.


From the git-rm man page:

A leading directory name (e.g. dir to remove dir/file1 and dir/file2) can be given to remove all files in the directory, and recursively all sub-directories, but this requires the -r option to be explicitly given.

Thus git rm -r /path/to/file does the same as git rm /path/to/file and stages the file for removal. However git rm -r /path/to/directory removes the directory and recursively everything it contains.


With -r you can remove complete directory trees.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜