gibo – プロジェクトに合わせた.gitignoreを生成
Gitでプロジェクトをはじめる際には.gitignoreを設定するでしょう。その際にはプロジェクトの言語や種類によってデフォルトとも言えるような設定が存在します。GitHubでは予めそうした.gitignoreを生成する機能がありますが、GitHub以外の場合は自分で用意しなければなりません。 そこで使ってみたいのがgiboです。多数のプロジェクトに対応した.gitignore生成ライブラリです。
giboの使い方
Mac OSXの場合はHomebrewで提供されています。
$ brew install gibo
これで準備は完了です。まずはヘルプを見てみましょう。
$ gibo --help
gibo 1.0.2 by Simon Whitaker <simon @goosoftware.co.uk>
https://github.com/simonwhitaker/gibo
Fetches gitignore boilerplates from github.com/github/gitignore
Usage:
gibo [options]
gibo [boilerplate boilerplate...]
Example:
gibo Python TextMate >> .gitignore
Options:
-l, --list List available boilerplates
-u, --upgrade Upgrade list of available boilerplates
-h, --help Display this help text
-v, --version Display current script version
プロジェクトを指定するだけでOKです。例えばRailsの場合は以下のように出力されます。
$ gibo Rails
### https://raw.github.com/github/gitignore/master/Rails.gitignore
*.rbc
capybara-*.html
.rspec
/log
/tmp
/db/*.sqlite3
/public/system
/coverage/
/spec/tmp
**.orig
rerun.txt
pickle-email-*.html
# TODO Comment out these rules if you are OK with secrets being uploaded to the repo
config/initializers/secret_token.rb
config/secrets.yml
## Environment normalisation:
/.bundle
/vendor/bundle
# these should all be checked in to normalise the environment:
# Gemfile.lock, .ruby-version, .ruby-gemset
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
良くある設定ですね。設定できる言語は実に多彩で、100は越えています。Gitのお陰で個人的なプロジェクトもさくっと立ち上げられるようになりましたので、予め入れておくと便利そうです。
giboはBashスクリプト製のオープンソース・ソフトウェア(Public Domain)です。