首页 > gitignore文件用法

gitignore文件用法

在.gitignore文件中,以下两行作用有什么区别吗?

/data/cache/
/data/cache/*


看这里:

If the pattern ends with a slash, it is removed for the purpose of the
following description, but it would only find a match with a

  1. In other words, foo/ will match a directory foo and paths

  2. it, but will not match a regular file or a symbolic link

foo (this is consistent with the way how pathspec works in general in
Git)

在我看来,这两个命令没区别。都是过滤/data/cache/目录下的所有内容


虽然意义不同,但是实现效果没有区别。都是屏蔽某个目录下的文件。


.gitignore配置文件用于配置不需要加入版本管理的文件,配置好该文件可以为我们的版本管理带来很大的便利。

希望对你有所帮助

【热门文章】
【热门文章】