Follow

The four words that put dread in my heart whenever I see them....

"Please rebase off master"

I end up just deleting my PR and re-creating it because for the life of me I can't drive git. It makes no sense.

@popey it does take a little while to get your head around it; A rebase on master is fairly easy as long as you don't hit too many conflicts - the easier way if you're not confident is just to checkout current master and just apply your patches on top.

@penguin42 That's what I usually end up doing. My patch is 2 lines, so easier to just commit that to personal memory and pop it back in master. Awful that I have to do that.

@popey There are easier ways to pop it back on master. First off 'git fetch origin;' Here's 3 different ways to try.
a) git rebase origin/master
that should do it - all done (unless you hit a conflict)
b) Make a note of the hash of your commit, do git checkout origin/master then git cherry-pick YOURHASH that will be very similar - it's just stuffed your patch ontop of where you currently are.

(git rebase --abort and git cherry-pick --abort to get out of them if stuck)

@penguin42 Thank you. I got as far as cherry picking, and I think it did it, and then I pushed, and it didn't do what I expected. :(

@popey making sure you're on the right branch when you cherry pick helps :-) and similarly convincingg it to push to the right place.

@popey
Do you tend to add your changes to stale branches? Sounds obvious but remembering to do a fresh git pull before committing changes, will minimise need for rebase

@simon This is not my fault for doing something wrong. Upstream merged an old PR.

@popey I have never figured out how to rebase either.
So I usually just reclone and redo all the stuff each time I need to rebase...

@popey I think then I'm qualified to work where you work, gizza job! 😋

Sign in to participate in the conversation
Ubuntu Social

This server was setup for the Ubuntu community to use.