gitignore檔案用法
怪我咯
怪我咯 2017-05-02 09:34:20
0
3
567

在.gitignore檔案中,以下兩行作用有什麼區別嗎?

/data/cache/
/data/cache/*

怪我咯
怪我咯

走同样的路,发现不同的人生

全部回覆(3)
某草草

看這裡:

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/目錄下的所有內容

Ty80

.gitignore設定檔用於配置不需要加入版本管理的文件,配置該文件可以為我們的版本管理帶來很大的便利。

  • 以斜槓「/」開頭表示目錄;

  • 以星號「*」通配多個字元;

  • 以問號「?」通配單一字元;

  • 以方括號「[]」包含單一字元的符合清單;

  • 以嘆號「!」表示不忽略(追蹤)符合的檔案或目錄;

希望對你有幫助

洪涛

雖然意義不同,但是實現效果沒有差別。都是屏蔽某個目錄下的檔案。

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!