msysgit 1.8.5.2 におけるpush時のwarning対応
msysgit 1.8.5.2にアップデートしたところgithubへのプッシュ時に下記のようなwarningが発生するようになりました。
$ git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) fatal: could not read Username for 'https://github.com': No such file or directory
調べてみたところ、このバージョンからブランチ名あるいはタグ名を指定せずにpushした場合の警告だそうです。
対応方法は、上記メッセージに書いてあるとおり、
git config --global push.default matching
または、
git config --global push.default simple
しておけばよいそうです。
従来通りの動作をさせたいならmatching、simpleにすると、upstreamのブランチ名やタグ名が現在のローカルと異なる場合はエラーになるそうです。
今後はsimpleがデフォルトになるそうですが、これを.gitconfigに設定してあげておかなくてはならないみたいです。
で完了と思ったら、push時に、
fatal: could not read Username for 'https://github.com': No such file or directory
とか言われてpushできなくなりました。
どうやらバグらしです。
今のところWindows用はまだバグ対応版(1.8.5.3)は出ていないようなので素直に前のバージョンに戻して使うしかなさそうです。