LoginSignup
16
16

More than 5 years have passed since last update.

gitignore.ioを使って、コマンドラインから一発で.gitignoreを作成する

Posted at

※OSX環境での手順です。

まず、gi コマンドとして、bashrcやzshrcに登録します。

% echo "function gi() { curl http://gitignore.io/api/\$@ ;}" >> ~/.zshrc && source ~/.zshrc

これで、作りたい言語を指定して、giコマンドを発行すると

% gi objective-c

.gitignoreに書くべき項目がリストアップされます。

% gi objective-c
# Generated by http://gitignore.io

### Objective-C ###
# Xcode
.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap

これをファイルに出力するようにすれば、コマンドラインから一発で.gitignoreファイルを作成できます。

gi objective-c > .gitignore

.gitignore作るときは今までgitignore.ioからコピペしてたんですが、これで圧倒的に速く作れるようになりました。

16
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
16