Skip to content

Rebase problem. #22305

Answered by lee-dohm
80kk asked this question in New to GitHub
Feb 20, 2019 · 1 comment
Discussion options

You must be logged in to vote

Interesting question.

The git rebase command documentation has some good diagrams that should help make things more clear. If you’ve created a new branch, named newbranch, that contains only the new commits that you want to move, you should be able to issue the command:

git rebase branch-where-you-wanted-the-commits-in-the-first-place newbranch

Then you can merge those new commits into the branch where you wanted them originally with the command:

git checkout branch-where-you-wanted-the-commits-in-the-first-place
git merge --ff newbranch

The --ff option is to ensure that you rebased things right and isn’t strictly necessary. You can then delete the newbranch branch and continue on as yo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants