博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Git 笔记 - .gitignore
阅读量:6186 次
发布时间:2019-06-21

本文共 1340 字,大约阅读时间需要 4 分钟。

The rules for the patterns you can put in the .gitignore file are as follows:

  • Blank lines or lines starting with # are ignored.

  • Standard glob patterns work.

  • You can end patterns with a forward slash (/) to specify a directory.

  • You can negate a pattern by starting it with an exclamation point (!).

Glob patterns are like simplified regular expressions that shells use. An asterisk (*) matches zero or more characters; [abc] matches any character inside the brackets (in this case a, b, or c); a question mark (?) matches a single character; and brackets enclosing characters separated by a hyphen([0-9]) matches any character between them (in this case 0 through 9). You can also use two asterisks to match nested directories; a/**/zwould match a/za/b/za/b/c/z, and so on.

 

Here is another example .gitignore file:

# no .a files*.a# but do track lib.a, even though you're ignoring .a files above!lib.a# only ignore the root TODO file, not subdir/TODO/TODO# ignore all files in the build/ directorybuild/# ignore doc/notes.txt, but not doc/server/arch.txtdoc/*.txt# ignore all .txt files in the doc/ directorydoc/**/*.txt

GitHub maintains a fairly comprehensive list of good .gitignore file examples for dozens of projects and languages at  if you want a starting point for your project.

 

转载于:https://www.cnblogs.com/derek-hu/p/4526143.html

你可能感兴趣的文章
Flyway做数据库脚本版本管理--开源
查看>>
我的友情链接
查看>>
iOS中的视频播放
查看>>
手机端与网页通过websocket通信
查看>>
Exchange刷新已禁用邮箱状态
查看>>
我的友情链接
查看>>
SQL*Loader使用方法
查看>>
ERP系统容灾方案典型架构
查看>>
我的友情链接
查看>>
D3.js学习
查看>>
kafka监控
查看>>
1-7华为HCNA认证eNSP基础B
查看>>
Linux中SUID和SGID详解
查看>>
windows下安装mysql5.7 (爬过多次坑)总结
查看>>
Django 01
查看>>
两人一组,注册账号密码,注册COOKIE是否能够登陆?
查看>>
Object-C中使用NSKeyedArchiver归档(将各种类型的对象存储到文件中)
查看>>
一位大牛整理的python资源
查看>>
设计模式 单例模式(Singleton)
查看>>
jqurey 隐藏
查看>>