作成日:2019-06-24, 更新日:2019-06-27
経緯(Sourcetree)
▼ブランチをチェックアウト(切替え)しようとしたらエラーが出てきた
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks -c credential.helper= -c credential.helper="C:/〇〇〇/〇〇〇/〇〇〇.EXE" checkout 〇〇〇 --progress error: Your local changes to the following files would be overwritten by checkout: 〇〇〇.〇〇〇 Please commit your changes or stash them before you switch branches. Aborting エラー終了しました。エラーの内容は上記をご覧ください。
・原因はコミットしていないから。
対策1:コミットをする
理由が無いならコミットをしてやればOK
対策2:コミットをしない(一時待避)
コミットするわけにいかないときは「一時待避」してやればいい
▼作業を一時退避(sourcetreeのコンソールより下記実行)
$ git stash
▼stashの使い方いろいろ
$ git stash pop //一時退避を元にもどす $ git stash list //一時退避の確認 $ git stash clear //一時退避の消去