ドキュメントには頻繁に更新が加えられ、その都度公開されています。本ページの翻訳はまだ未完成な部分があることをご了承ください。最新の情報については、英語のドキュメンテーションをご参照ください。本ページの翻訳に問題がある場合はこちらまでご連絡ください。

Creating a commit with multiple authors

You can attribute a commit to more than one author by adding one or more Co-authored-by trailers to the commit's message. Co-authored commits are visible on GitHub Enterprise and can be included in the profile contributions graph and the repository's statistics.

ここには以下の内容があります:

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

OR, learn how to contribute.

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.

Add a co-author to the commit message

Creating co-authored commits on the command line

  1. Collect the name and email address for each co-author.

  2. コミットメッセージと、変更の短く分かりやすい説明を入力してください。 コミットの説明の後に、閉じる引用符の代わりに 2 つの空の行を追加してください。

    $ git commit -m "Refactor usability tests.
    >
    >

    Tip: コミットメッセージを入力するのにコマンドライン上のテキストエディタを使っているなら、コミットの説明とコミットトレーラーのCo-authored-by:との間に新しい2行があることを確認してください。

  3. 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.

  1. Collect the name and email address for each co-author.

  2. After making your changes together, at the bottom of the page, type a short, meaningful commit message that describes the changes you made.

    Commit message for your change

  3. 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 and Co-authored-by: commit trailer.

    Commit message co-author trailer example in second commit message text box

  4. Click Commit changes or Propose changes.

The new commit and message will appear on your GitHub Enterprise Server instance.

Further reading

Did this doc help you?

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

OR, learn how to contribute.