-
I use PRs on one of my repos so I remember to properly review them before I merge them, however I like to merge them as one commit (like the 'squash and merge' button on GitHub). Is there a way to do this in emacs directly to save opening my browser? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can do that by invoking It is not possible to replicate Github's behavior without actually using Github (in this case its API). When you click on squash&merge, Github does not (as I think it should) first update the feature branch and then fast-forward the target branch to the tip of that. Instead it creates a temporary branch and then updates and ff-merges that. The result is that the feature branch forever stays in its original state and that tools other than Github itself cannot easily tell that it has been merged. I recommend that instead of using that command you use Magit to rebase. Use the "fixup" action to combine the commits into one. Inspect the resulting commit before proceeding. Force-push the result to Github. Use "merge into" ( |
Beta Was this translation helpful? Give feedback.
You can do that by invoking
forge-merge
with a prefix argument.It is not possible to replicate Github's behavior without actually using Github (in this case its API). When you click on squash&merge, Github does not (as I think it should) first update the feature branch and then fast-forward the target branch to the tip of that. Instead it creates a temporary branch and then updates and ff-merges that. The result is that the feature branch forever stays in its original state and that tools other than Github itself cannot easily tell that it has been merged.
I recommend that instead of using that command you use Magit to rebase. Use the "fixup" action to combine the commits into one. Inspe…