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

Use rebase-and-merge instead of merge #1081

Closed
rht opened this issue Nov 18, 2021 · 8 comments
Closed

Use rebase-and-merge instead of merge #1081

rht opened this issue Nov 18, 2021 · 8 comments

Comments

@rht
Copy link
Contributor

rht commented Nov 18, 2021

There are lots of merge commits in the commit history. Moving forward, this can be cleaned if the rebase-and-merge is selected as the default in the GitHub settings of this repo. See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/about-merge-methods-on-github#rebasing-and-merging-your-commits. Example of projects with clean commit history: https://github.com/zulip/zulip/commits/main.

Notice that the pull request number can still be found in the commit detail even with this method: zulip/zulip@5300ad8.

@EwoutH
Copy link
Contributor

EwoutH commented Nov 25, 2021

Agree, Rebase and merge is much cleaner for the commit history.

One disadvantage however is that Rebase and merge does destroy commit signatures.

@rht
Copy link
Contributor Author

rht commented Nov 26, 2021

The commit signatures can be retained if the branch is rebased (by the PR creator) on top of latest main, and then the maintainer do a git pull --rebase from the PR branch.

@jackiekazil
Copy link
Member

@rht I am confused by settings in your comments.
You are suggesting setting it as the default then also encouraging folks during the the PR Rebase -- on the command line?
Or call all this be set in the settings and am I missing it?

@rht
Copy link
Contributor Author

rht commented Nov 27, 2021

You can ignore my comment on the command line rebase. Most people don't sign their commits anyway, so using GH's rebase and merge button should work.

@EwoutH
Copy link
Contributor

EwoutH commented Dec 14, 2021

On recent commits the reference to the pull request is gone, so the (#PR). This makes it more difficult to find the original pull request. How can this be fixed when merging?

32725691-D7DC-4353-8D2D-BF165879D451

@rht
Copy link
Contributor Author

rht commented Dec 14, 2021

If you click on the individual commit, you will see the PR number, e.g. d224397 is #1099.

@rht
Copy link
Contributor Author

rht commented Dec 14, 2021

2021-12-14-070644_345x202_scrot

@rht
Copy link
Contributor Author

rht commented Dec 14, 2021

I suppose I can close this now, since currently the default is rebase and merge.

@rht rht closed this as completed Dec 14, 2021
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

3 participants