やりたいこと
- gitで自分のローカル環境ファイルだけ無視したい。
- 共通の
.gitignore
は編集したくない。
色々参考にして、.git/info/exclude
ファイルに追記すればOKということがわかった。
ただ自分の場合は.gitディレクトリ内にinfoディレクトリもなければexcludeファイルも無かったのでそこからの適用方法。
まずはターミナルでプロジェクトディレクトリに入ったあと、
プロジェクトフォルダから.gitディレクトリに移動
$ cd .git
infoディレクトリ作成
$ mkdir info
excludeファイル作成
ディレクトリ移動
$ cd info
excludeファイル作成
$ touch exclude
.git/info/
にexcludeファイルが作成されていることを確認。
テキストエディタでexcludeファイルを開き、.gitignore
と同じ要領で除外ファイルを適用。