Open wada811 opened 5 years ago
ブランチを切ってコミットを行った。 しかし、間違ったブランチからブランチを切ってしまっていた。 そのため、正しいブランチからブランチを切り直したい。
間違って master から切った feature/branch を develop に付け替える。
master
feature/branch
develop
git rebase の --onto オプションを使う。
git rebase
--onto
git rebase [--onto <newbase>] [<upstream>] [<branch>] --onto <revision> rebase onto given branch instead of upstream
上記の例では、以下のコマンドを実行する。
git rebase --onto develop master feature/branch
Why
ブランチを切ってコミットを行った。 しかし、間違ったブランチからブランチを切ってしまっていた。 そのため、正しいブランチからブランチを切り直したい。
What
間違って
master
から切ったfeature/branch
をdevelop
に付け替える。How
git rebase
の--onto
オプションを使う。上記の例では、以下のコマンドを実行する。
Ref