1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Sourcetreeでスタッシュを適用して怒られたときの対処法

Last updated at Posted at 2020-11-26

はじめに

Sourcetree でスタッシュを適用したときに下記のように怒られたときの対処法です。

Please, commit your changes or stash them before you can switch branches.

もちろん差分なんてなにもない。。。でも怒られる:scream:

対処法

とりあえずきれいにすればいい:sparkles:
下記コマンドで追跡対象外のファイルとディレクトリを削除します。

$ git clean -n
$ git clean -df

これでもダメならいったん他のブランチに切り替えて上記コマンドを実行してみる(わたしはこれで復帰できました:tada:)。

おわりに

今まではスタッシュに置いてるやつはちょっとした修正だけだったのであきらめてたけどこれで復帰できるようになりました:raised_hands:

Git はこの際ターミナルで扱うようにしてもいいかもしれない:thinking:
ここ見ればだいたいできそう。
Gitコマンド早見表

参考

1
0
4

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?