LoginSignup
1
1

More than 5 years have passed since last update.

no branch, rebasing | git

Posted at

発生状況

gitでコンフリクトを発生させテストしていて
Git branchで現場を確認しようとしたところ発生。

エラーメッセージ


$ git branch #現在のブランチを確認
* (no branch, rebasing fiz)
  master
  fiz

$ git checkout master #マスターブランチに切り替え
example.txt: needs merge
error: you need to resolve your current index first

インデックス(ステージングエリアの管理をしているファイルみたいなイメージ)で
コンフリクトが発生している状態でブランチ切り替え時にエラーが発生している。

対処法


git reset --merge

Git reset --mergeはワーキングツリー(実際のフォルダ)の状態まで
インデックスをリセット(巻き戻)します。
原文

これでブランチの切り替えができるようになりました。

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