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?

今いるブランチを最新の状態にする

Posted at

0. まず作業内容をコミット or 一時退避

修正が未コミットのままなら、どちらかをやる:

# A: ちゃんとコミットしておく(推奨)
git add .
git commit -m "WIP: いまの修正"

# B: 一時的に避難させる(どうしてもコミットしたくなければ)
git stash push -m "wip before rebase"

rebase は「コミット」を並べ替える操作なので、
未コミットの変更があると怒られます。

1. develop ブランチを最新にする

git switch develop
git pull origin develop

2. 作業ブランチに戻る

git switch あなたのブランチ名

3. 最新 develop の上に rebase

git rebase develop
  • ここでコンフリクトが出たら:

    # コンフリクトを解消してから
    git add <直したファイル>
    
    # 1コミット分のrebaseを続行
    git rebase --continue
    
  • どうしても無理そうなら:

    git rebase --abort  # rebase開始前の状態に戻る
    
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?