LoginSignup
3
3

More than 5 years have passed since last update.

git addできないCRLFのファイルたちに向けて放つgit alias

Posted at

何度もこのQiitaにお世話になった。
http://qiita.com/mist_dev/items/f3f2bb04ef57e6474779

気づけばCRLFのファイルにぶち当たる度、このページを開いてコピペしてターン

$ git add .
fatal: CRLF would be replaced by LF in repo/file.
$ find ./* -type f | xargs -n 256 nkf -Lu --overwrite
$
$ git add .
$ 
# いけたいけたふ~

って繰り返すなら一発でいける方法取ろうと思った今日

# git alias として登録 
$ git config --global alias.filter '!find ./* -type f | xargs -n 256 nkf -Lu --overwrite'

# こんな感じで使えます(filterの文言はお好みで)
$ git filter

git add叩くだけでgit filter通しちゃうのもありかもしれない

3
3
1

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
3
3