Okay I almost have this rebase thing figured out.
I can feel a breakthrough coming - here is the tipping point:
How do I do a rebase to go from:
A - - B - - C - - D - - E (HEAD)
|
\ - - F - - G (branch1)
To:
A - - B - - C - - D - - E (HEAD)
|
\ - - F - - G (branch1)
I don't just want to merge HEAD~1 into branch1, I think I want to rebase branch1 right?
I feel like I almost grok this - help!?
Using the git checkout Command The git checkout -b <BranchName> command will create a new branch and switch to it. Moreover, this command will leave the current branch as it is and bring all uncommitted changes to the new branch.
We can do this by git reset –hard HEAD^ and moving the head pointer by one after one commit, git reset –hard HEAD~n will move the master branch 'n' commits before the recent commit, and git reset –hard <sha1-commit-hash> will directly move the master branch to the desire commit.
This is a standard rebase
, there's nothing tricky going on. You want to:
git checkout branch1
git rebase D
This can be done with git rebase:
git checkout branch1
git rebase {COMMIT ID of D}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With