Open wada811 opened 5 years ago
ローカルでリポジトリを作成しコミットした。 GitHub でリポジトリ作成時に LICENSE.md などを作成した。 その結果、ローカルとリモートで root の異なる2つのブランチを作成してしまった。
LICENSE.md
origin/master にローカルの master ブランチのコミットを積み重ねる。
origin/master
master
git rebase --onto の に --root を指定する。
git rebase --onto
--root
git rebase [--onto <newbase>] [<upstream>] [<branch>] --root rebase all reachable commits up to the root(s)
上記の例では、以下のコマンドを実行する。
git rebase --onto origin/master --root master
Why
ローカルでリポジトリを作成しコミットした。 GitHub でリポジトリ作成時に
LICENSE.md
などを作成した。 その結果、ローカルとリモートで root の異なる2つのブランチを作成してしまった。What
origin/master
にローカルのmaster
ブランチのコミットを積み重ねる。How
git rebase --onto
の--root
を指定する。上記の例では、以下のコマンドを実行する。
Ref