LoginSignup
3
3

More than 3 years have passed since last update.

コミットせずに他のブランチで作業したい

Posted at

シチュエーション

ある対応をしている時に別の依頼をされることは仕事ではよくあること。
現在行っている対応が、コミットするには中途半端で、
コミットせずに別の依頼の対応を行いたいときのGitのTIPSです。

git stashを使います。

手順

① 現在行っている対応(now-branch)を一時退避

$ git stash

② 別の対応のブランチに切り替え

$ git checkout other-branch

③ 止めていた対応のブランチに切り替える

$ git checkou now-branch

④ 一時退避していたものを戻す

$ git stash pop

最後に

とても便利なTIPSです。同じようなことで悩んでいる方はぜひ使ってみてください。

3
3
0

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
3
3