Skip to main content

このバージョンの GitHub Enterprise サーバーはこの日付をもって終了となります: 2026-08-25. 廃止されたリリースはサポートされていません。 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 GitHub Enterprise Server のパフォーマンスの向上、セキュリティの向上、新機能については、「アップグレード プロセスの概要を参照してください。 アップグレードに関するサポートについては、GitHub Enterprise Support にお問い合わせください。

Troubleshooting commits

Resolve common commit issues like incorrect user links, missing local commits, and push protection blocks.

Commits are linked to the wrong user

GitHub links a commit to a user by matching the email address in the commit header to an email address on a GitHub account. If your commits are linked to the wrong user or no user, update your Git email settings and add the email address to your account.

メモ

If your commits are linked to another user, that does not give them access to your repository.

Commits are linked to another user

  1. Change the email address in your local Git configuration by following コミットメールアドレスを設定する. If you work on multiple machines, change this setting on each one.
  2. Add the email address to your account by following GitHub アカウントへのメール アドレスの追加.

Future commits that use the email address will be linked to your account.

Commits are not linked to any user

To find out why a commit is not linked, inspect the commit on GitHub.

  1. GitHub で、リポジトリのメイン ページに移動します。

  2. リポジトリのメイン ページで、ファイル リストの上にある [ commits] をクリックします。

    リポジトリのメイン ページのスクリーンショット。 時計のアイコンと [178 件のコミット] がオレンジ色の枠線で強調表示されています。

  3. 特定のコミットに移動するには、そのコミットのコミット メッセージを選びます。

    リポジトリのコミット一覧にあるコミットのスクリーンショット。 [README.md の更新] がオレンジ色の枠線で強調表示されています。

  4. Hover over the blue to the right of the username.

  5. Use the message to decide what to update:

    • Unrecognized author (with email address): Add the shown email address to your GitHub account.
    • Unrecognized author (no email address): Set your commit email address in Git, then add that address to your GitHub account.
    • Invalid email: Set a valid commit email address in Git, then add that address to your GitHub account.

Old commits might not be linked after you update your email settings. See コミットメールアドレスを設定する.

A commit exists on GitHub but not in your local clone

If git show COMMIT-SHA returns an error locally but the commit is visible on GitHub, your local clone may be out of date or the commit may no longer be referenced by a branch.

The local repository is out of date

Fetch information from the remote repository.

git fetch REMOTE

Use git fetch upstream for a fork's upstream repository, or git fetch origin for the repository you cloned.

The branch that contained the commit was deleted

If the branch was deleted or force pushed, ask a collaborator who still has the commit locally to push it to a new branch.

git branch recover-B B
git push upstream B:recover-B

Then, fetch the recovered branch.

git fetch upstream recover-B

Avoid force pushes

Avoid force pushing unless necessary, especially when more than one person can push to the repository. Force pushing rewrites repository history and can disrupt collaborators or corrupt pull requests.

A commit is blocked by push protection

Push protection blocks commits, uploads, or API requests that contain supported secrets.

Understanding why push protection has blocked your commit

If push protection blocks your work, GitHub detected a supported secret in your commit or request. Remove the secret before trying again.

Resolving a push protection block

  1. Review the push protection message to identify the secret and where it appears.
  2. Remove the secret from the commit, file upload, or API request.
  3. Try the push, commit, upload, or request again.
  4. If you believe the secret is safe to push, follow the bypass steps for your workflow:

Further reading