覚書

日々学んだことをつらつらと

git

global な excludesfile が効かない話

git

git config --global excludesfile = ~/.gitignore_global を実行しても、gitignoreが適用されないという事象に1週間ぐらい悩んでいた。 原因は簡単で local に excludesfile が設定されていたから globalよりもlocalの方が強いのは当たり前ですよねーorz

sshキー設定のあれこれはgithub先生が資料を公開してくれている

git

ありがたい。資料をくれといわれたら、このURLを渡せば良い( *´艸`) Generating an SSH key - User Documentation

特定のパスのgitconfigを使う

git

以下のようにする。自分の環境の場合は、~/dotfiles/.gitconfig に共通のgitconfigがある。共通で使いたいaliasなどが入っている git config --global include.path ~/dotfiles/.gitconfig .gitconfigを直接編集するようなブログしか引っかからなかったので…

git のコミットメッセージをvimで書くときに自動で折り返されないようにする

autocmd FileType gitcommit setlocal textwidth=0 をvimrcに加えればOK 上記を調べる上で必要だった知識メモ 現在のファイルタイプを確認するには set filetype? とコマンドを叩く

git checkout で error が発生する理由が解らなかった話

git

checkoutで、以下のエラーが出力された。 $ git checkout hoge error: Your local changes to the following files would be overwritten by checkout: foo/bar Please, commit your changes or stash them before you can switch branches. Aborting status…