gitignore文件用法

查看:78
本文介绍了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文件用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆