Skip to content

Commit c18f950

Browse files
committed
update post
1 parent 4c33cd8 commit c18f950

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

‎_posts/2017-02-22-使用-.gitignore-忽略-git-仓库中的文件.md‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,24 @@ tags:
1616

1717
> 使用 `.gitignore` 文件忽略制定文件
1818
19-
# .gitignore
19+
## .gitignore
2020

21-
打开 **SourceTree** 仓库设置可以发现 仓库忽略列表选项中默认有个 `.gitignore`,用来忽略你不想 `Commit` 到仓库中的文件,这对于多人合作开发意义重大~
21+
打开 **SourceTree** 仓库设置可以发现 仓库忽略列表选项中默认有个 `.gitignore`,用来忽略你不想 `Commit` 的文件。
2222

2323
![](https://ww1.sinaimg.cn/large/006tNbRwgy1fd07hwkuy5j30vq080t9x.jpg)
24-
25-
# 下载地址:
26-
27-
git@github.com:github/gitignore.git
28-
or
24+
25+
26+
## 忽略文件的格式
27+
28+
- `#` :此为注释 – 将被 Git 忽略
29+
- `*.a` :忽略所有 `.a` 结尾的文件
30+
- `!lib.a` : 不忽略 `lib.a` 文件
31+
- `/TODO` :仅仅忽略项目根目录下的 `TODO` 文件,不包括 `subdir/TODO`
32+
- `build/` : 忽略 `build/` 目录下的所有文件
33+
- `doc/*.txt` : 会忽略 `doc/notes.txt` 但不包括 `doc/server/arch.txt`
34+
35+
## 下载地址
36+
github上整理了一些常用需要的项目中需要忽略的文件配置,根据需要进行获取
2937

3038
https://github.com/github/gitignore.git
3139

@@ -39,7 +47,9 @@ or
3947

4048
其他两个在 `Xcode.gitignore` 基础上针对不同的语言进行忽略
4149

42-
# 使用方法:
50+
51+
52+
## 使用方法
4353

4454
1. 将文件拖入项目根目录
4555

@@ -53,3 +63,4 @@ or
5363

5464
将文件名/文件夹名 添加到 `.gittignore` 文件中即可
5565

66+

0 commit comments

Comments
 (0)