Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition: merge commits in feature branches, soft reset to base #111

Open
himdel opened this issue Jul 27, 2021 · 0 comments
Open

Addition: merge commits in feature branches, soft reset to base #111

himdel opened this issue Jul 27, 2021 · 0 comments

Comments

@himdel
Copy link

himdel commented Jul 27, 2021

Proposing an addition along the lines of...

Oh shit! I ran git pull in the wrong branch and now my PR has a merge commit, and it disappears on rebase, but also I ammended the merge commit with more changes and those disappear as well!

Presumably with the proposed solution of (unless someone has a better way):

# remove all the commits from your branch, without removing the changes
git reset master
# manually pick the changes that do belong in your PR (any commits added to master since the last branch rebase will appear undone after the reset)
git add -Ap
# recreate the commit(s) without any merges; push
git commit ...; git push -f ...
# clean up the rest of the changes
git reset --hard

Proceed to $ingest heavily.

( Possibly prefixed by git reflog; git reset --hard $MERGE_COMMIT when trying to fix this after finishing a rebase. )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant