But I'll just say that I typically try to avoid rebasing the branch commits against master. If you'd still prefer to rebase branch against master then I would check out an entirely new branch based off of master and use that for the karaf rebase. Actually, I'd do that either way. I'd do the following:
1. Make sure your master branch is up to date:
$ git checkout master
$ git pull upstream master
2. Check out a branch based off of master in case all goes to hell:
$ git checkout -b master-2
3. Go back to the karaf branch and get an idea of how many commits you have vs. master (looks like around 221 judging by
this):
$ git checkout karaf
$ git rev-list --count HEAD ^master-2
4. Rebase against the new master-2 branch:
$ git rebase -i HEAD~221
* May not actually be 221, replace with the number you get in step 3.
Surely you know this already, but in the event that it helps here are some vim tips:
- Enter interactive mode by typing `I` and only leave the first commit as `pick`, type `s` or `squash` for the rest. You can also use `f` or `fixup` if you don't want to include the commit message.
- Save and quit by typing `wq!` and pressing enter. You'll probably have to repeat this.
- If you get stuck or want to quit without saving (completely cancel the rebase), just press Esc to exit interactive mode on vim and type `:%d|x`, then press enter.
Once you're done, you may want to change the commit message for that single commit, so you'd just do `git commit --amend -m "Blah blah"`. You'll probably have to do `git push origin karaf --force` as you'll likely get an error about pushing to your fork's karaf branch.
Having said that, it's probably going to take you a bit to go through it. `gitk` may or may not be helpful. Committing early and often (as well as rebasing against the latest master branch) would prevent this problem for you in the future. Hope that helps! If not, Marc may be your guy.
Rachel