You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong git author when merging a pull request using gh #3032
I fell in love with your cli tool It's bodacious and speeds up the workflow tremendously!
When using gh to merge a pull request using gh pr merge <no> and requesting a merge commit, the merge commit was not carried out with the commit author set in .git/config of the working copy where the merge happens. Which git author settings (user.name/user.email) are actually taken when directly merging with gh? Local global (~/.gitconfig) or the primary address of the github account?
[email protected] as the primary email address in the github.com profile (but also having [email protected] as an additional email address there)
[email protected] in .git/config of the current working copy in question,
I expect the merge to be carried out by the email.name/email.user pair set in local .git/config - the same that git would use. But that is not what happens. [email protected] hab been taken for the merge commit, when merging the pull request using gh pr merge <no>.
As my primary account address at github is the same as in ~/.gitconfig, I can't say which one of the two is taken, but I assume it's the primary account address and first/last name of the github account, isn't it?
Ok I was able to verify the open question when merging another branch. gh uses the primary address of the github account to create the merge commit when merging the pull request. IMHO this should not be the case if there is a .github/config in the current working copy. Then this email.name/email.user pair should take precedence.
Activity
mrolli commentedon Feb 24, 2021
Ok I was able to verify the open question when merging another branch. gh uses the primary address of the github account to create the merge commit when merging the pull request. IMHO this should not be the case if there is a .github/config in the current working copy. Then this email.name/email.user pair should take precedence.
mislav commentedon Feb 24, 2021
Thanks for the suggestion! Right now it's not possible to change the author when using
pr merge, but we might make it possible in the future: #1450