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

git pullしたら、git checkoutできなくなった。(error: you need to resolve your current index first)

Last updated at Posted at 2020-12-19

git checkoutできなくなった。 conflict解消したのになんで??

チーム作業で、他のメンバーの編集したブランチをpullしたら、自分の作業ブランチに戻れなくなった。

原因

vocstartsoft:~/environment/app (develop|MERGING) $ git checkout [戻りたいブランチ]

error: you need to resolve your current index first

git pullして、conflictを解決したのに、checkoutできない!
ブランチの状態がMERGINGになっているのが原因。(解消したconflictがリポジトリに反映されていない。)

解決策

vocstartsoft:~/environment/app (develop|MERGING) $

Conflictを解消した後に、

vocstartsoft:~/environment/app (develop|MERGING) $ git add .
vocstartsoft:~/environment/app (develop|MERGING) $ git commit -m "コメント"

conflictが解消されているなら、commitすることで、正常にmerge出来たことになる。
「|MERGING」の記述も消えているはず。

vocstartsoft:~/environment/app (develop) $
0
0
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
0
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?