4
1

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 1 year has passed since last update.

git pullしたらこんな画面出てきた

image.png

[引用]https://teratail.com/questions/162046

ある時mainブランチにある情報をpullしてこようと思った時に、このような画面に飛びました。
このモードってどのボタンを押してもほとんどエディタに反応がないので、新卒の人はめちゃくちゃ焦ると思うんですよね...

でも、大丈夫です!
このモードはvimというもので、git上のエラーでも何でもありません!

vimが起動する理由

なぜエディタか発動するかというと、自分のブランチにも1つ以上のコミットがあり、同時にリモートにも新しいコミットがあると、git mergeが必要となります。
ここでマージコミットを残すために、エディタが起動する。
という仕組みです。

解決方法

これは何かメッセージを残してもよいらしいのですが、筆者は
:wq
と入力だけして閉じました。
これだけで、git pullは完了します。
たまに:cqで解決できるという記事も見かけますが、:cqはエラーのまま処理を終了するという意味があるため、今回の例だと不適切です。

最後に

「もっとこうしろよ」
や
「○○の方がいいのに」
などと言った意見がありましたら、Qiitaのコメント欄にてお願いします!

4
1
2

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?