Required co-author information
Before you can add a co-author to a commit, you must know the appropriate email to use for each co-author. For the co-author's commit to count as a contribution, you must use the email associated with their GitHub Enterprise account.
Creating co-authored commits using GitHub Desktop
You can use GitHub Desktop to create a commit with a co-author. For more information, see "Write a commit message and push your changes" and GitHub Desktop.

Creating co-authored commits on the command line
-
Collect the name and email address for each co-author.
-
输入提交消息以及简短、有意义的更改描述。 在提交描述后,不要加上右引号,而是添加两个空行。
$ git commit -m "Refactor usability tests. > >提示: 如果您使用文本编辑器在命令行上输入提交消息,请确保在提交描述末尾与
Co-authored-by:提交尾行之间有两个换行符。 -
On the next line of the commit message, type
Co-authored-by: name <name@example.com>with specific information for each co-author. After the co-author information, add a closing quotation mark.If you're adding multiple co-authors, give each co-author their own line and
Co-authored-by:commit trailer.$ git commit -m "Refactor usability tests. > > Co-authored-by: name <name@example.com> Co-authored-by: another-name <another-name@example.com>"
The new commit and message will appear on your GitHub Enterprise Server instance the next time you push. For more information, see "Pushing changes to a remote repository."
Creating co-authored commits on GitHub Enterprise
After you've made changes in a file using the web editor on GitHub Enterprise, you can create a co-authored commit by adding a Co-authored-by: trailer to the commit's message.
-
Collect the name and email address for each co-author.
-
After making your changes together, at the bottom of the page, type a short, meaningful commit message that describes the changes you made.

-
In the text box below your commit message, add
Co-authored-by: name <name@example.com>with specific information for each co-author. If you're adding multiple co-authors, give each co-author their own line andCo-authored-by:commit trailer.
-
Click Commit changes or Propose changes.
The new commit and message will appear on your GitHub Enterprise Server instance.