Closed cjyetman closed 3 years ago
side note: @jdhoffa or @maurolepore I'd like to understand why the commit history from previous branches is following me around and how to get rid of it here for instance, while complying with the "don't change the shared git history" guideline
why the commit history from previous branches is following me around and how to get rid of it here for instance
I usually get in that situation when I create a new branch not off master
but off the head of an existing PR. I don't know how to fix this PR and instead I would close it and resubmit. The new one should have all relevant commits on top of master
-- after you ensure that master
is in sync with origin/master
.
To move the relevant commits you may create and checkout a new branch off the syncronized master
, then git cherry-pick sha1 sha1 sha3
or move all commits at once with git rebase --onto master sha1 sha3
-- but please check the docs because I use git rebase --onto
infrequently. Jackson may have it fresh in his mind.
If you prefer, I'm happy to try do it on my end.
interesting... this is where I would normally start researching doing a rebase, but I thought the guidance was to never do a rebase?
Indeed, so you wouldn't/ shouldn't do the rebase on a shared branch (ie. this one). The process would be:
use-jquerylib-#5
), called use-jquerylib-clean#5
or something like thatrebase --onto
is handy if you happen to know which branch gave you these leftover commits (I gave a pretty in depth explanation of it in #coding on slack, can tag you if you're interested)closing this in favor of #9
fyi... using RStudio's git pane, this is how I ended up doing this...
and that was it... came to GitHub and it offered to start a new PR based on this new branch that had been created... and the new branch/PR has only the one commit I wanted in it
🤷🏻
use jquerylib instead of including jQuery in this repo/pkg
closes #5