のぐそんブログ

暗いおじさんがシコシコ書くブログです。

git pullできなかったときのメモ

git pullをしようとしたら、↓のエラーがでました。

また同じことが起きたときの為にメモです。

error: Your local changes to the following files would be overwritten by checkout:hogehoge.rb
Please commit your changes or stash them before you switch branches.

メッセージの通りにgit stashしたりしてみましたが解消しませんでした。

こちらの記事の方法で解消しました。

qiita.com

git 管理外のファイルをチェック

git ls-files -v | grep ^S

git管理に戻す。

git update-index --no-skip-worktree hogehoge.rb