いい感じの.gitignoreファイルをらくらく作成する

.gitignore、プロジェクトごとにいい感じのものテンプレートあると便利ですよね。

f:id:naoto5959:20140714170656p:plain

そういうテンプレートがまさに、github/gitignore にあるのですが、そのテンプレートをコマンドラインから持ってくるgemがgemignoreである、とのこと。

install

gem install gemignore
# もしくは
# rbenv exec gem install gemignore
# とか

使い方

.gitignoreがなければ作ります

touch .gitignore

対応しているプロジェクトを見てみる

gemignore list

検索してみる

gemignore search obj

試しに、Objective-Cを入れましょう

gemignore a Objective-C
cat .gitignore
# Added by gemignore. Snippet 'Objective-C'
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Pods/

いいね!

MacOSで開発するので、ついでに

gemignore a Global/OSX

以下が足されました。

# Added by gemignore. Snippet 'Global/OSX'
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

いい感じ。