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?

【GitHub】誤ったブランチでコード編集を行った場合の対応

Posted at

記事概要

ブランチの作成を忘れた場合や、別のブランチにコードを記入した場合の対応方法について、記述する。

事象

トピックブランチではなく、mainブランチにコード修正が適用されている

原因

トピックブランチの作成を忘れ、mainブランチで作業を進めてしまったため

解消方法

  1. 新しいブランチを作成する
  2. Bring my changes to 新しいブランチ名を選択する
    表記 意味
    Leave my changes on master (main) 元のブランチで書いていたコードを保留にして、新しいブランチで0からコードを書く選択です。
    Bring my changes to 新しいブランチ名 元のブランチで書いていたコードを新しいブランチに引き継ぐ選択です。
  3. mainブランチの修正コードが新しいブランチに移動する
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?