8 个版本
| 0.2.4 | 2020 年 7 月 5 日 | 
|---|---|
| 0.2.3 | 2020 年 5 月 22 日 | 
| 0.1.2 | 2020 年 4 月 29 日 | 
#2936 在 命令行工具
每月 24 次下载
1MB
251 行
gib - 为使用 git 的项目提供 .gitignore 引导程序
这是一个小工具,用于需要为不同的语言或框架生成 .gitignore 文件的人。 gib 使用 .gitignore 模板,允许从它们检查和生成这些文件。这些模板直接从 GitHub 的 gitignore 存储库 收集。
安装
您可以从 GitHub 的发布页面下载适用于可用平台的二进制文件 [GitHub 发布页面]
Homebrew (macOS)
brew install davsanchez/gib/gib
或者使用 brew tap davsanchez/gib,然后 brew install gib。
来自 crates.io
如果您已在您的计算机上安装了 Rust,则只需执行以下操作
cargo install gib
从源代码安装
您还需要安装 Rust
git clone https://github.com/DavSanchez/gib.git --recurse-submodules
cd gib
cargo install
用法
在当前目录创建 .gitignore(如果不存在)
gib [<template>...] 
如果该位置已存在 .gitignore 文件,则 gib 将不执行任何操作。
如果您想扩展现有文件,请使用 -a|--append 标志。如果您想覆盖它,请使用 -r|--replace(append 优先于 replace)。
在其他目录创建 .gitignore
gib [<template>...] [-o|--output] [<path>]
获取可用模板列表
gib [-l|--list]
仅将指定模板的结果打印到 stdout
gib [<template>...] [-s|--show]
此标志优先于 --append、--replace 和 --output 标志。
示例
输出 Go 和 Rust 的 .gitignore 文件
gib go rust
.gitignore
###############
#   Go
###############
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
###############
#   Rust
###############
# Generated by Cargo
# will have compiled files and executables
/target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
待定更改
- 其他安装方式(macOS 的 brew、Windows 的scoop或choco等。)
- 优秀的man手册、自动补全和文档。
- 将 .gitignore模板加载替换为lazy_static或phf。
- 重构,重构...
依赖项
~3.5MB
~59K SLoC