On 23/02/2009, at 12:57 PM, Bryan Ischo wrote:
OK, so I guess I really need to get into the habit of using git- rebase -i.
Yes, git rebase is one of the most wonderful things about git. It really makes git flexible. Remember never to rebase on published commits though, as that would screw things up for people who pulled from you already. Of course there's no problem with that when sending patches.
One question: I should do the rebase -i onto a new branch, right, so as not to disturb my existing branch? Because if I make a mistake, I want to be able to recover by blowing away the branch I was rebasing into, and starting over with a new one.
You could do that, but there's also git reflog, which shows where your HEAD has been. If you screw something up, you can find the correct HEAD and attach it to a branch. It's git's safety net of sorts. I haven't actually done that so I am unsure as to how effective it would be, but it's there, and it has saved me a few times.