Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I have github do PR merges with a specific email/user info?

Tags:

git

github

I have the following situation. At github I have two email address: stefano@home and stefano@work. My github account is configured for stefano@home to be the primary address. At work, I correctly set up my git checkouts to create commits with stefano@work. However, when I go to github and merge PRs onto work's repos, my merge commits appear with stefano@home address.

How can I say that all PR merges on that specific repo must have stefano@work?

like image 358
Stefano Borini Avatar asked Sep 25 '15 13:09

Stefano Borini


People also ask

Can you add two emails to GitHub?

GitHub allows you to add as many email addresses to your account as you like. If you set an email address in your local Git configuration, you will need to add it to your account settings in order to connect your commits to your account.

What is the difference between a pull request and a merge request?

A Git pull request is essentially the same as a Git merge request. Both requests achieve the same result: merging a developer's branch with the project's master or main branch. Their difference lies in which site they are used; GitHub uses the Git pull request, and GitLab uses the Git merge request.

How do I force merge PR on GitHub?

Under your repository name, click Pull requests. In the "Pull Requests" list, click the pull request you'd like to merge. Depending on the merge options enabled for your repository, you can: Merge all of the commits into the base branch by clicking Merge pull request.


2 Answers

Merging from the GitHub UI always used the primary email address on your account, ...
But, since April 24th 2019 (4 years later):

"Choose your merge commit email"

You can now choose the author email for commits created when merging pull requests via the web.
As a reminder, you can also choose the author email for web-based edits.

For more information, see merging a pull request.

enter image description here

like image 101
VonC Avatar answered Sep 28 '22 09:09

VonC


Merging from the GitHub UI always uses the primary email address on your account, or the private @users.noreply.github.com version if you've checked that box. If you want to use different emails per repository, you'll have to git merge from the command line. GitHub will still close the PR properly.

like image 37
Kristján Avatar answered Sep 28 '22 08:09

Kristján