Skip to main content

このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2022-10-12. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの向上、新機能の向上を図るために、最新バージョンの GitHub Enterprise にアップグレードします。 アップグレードに関するヘルプについては、GitHub Enterprise サポートにお問い合わせく� さい

Caching your GitHub credentials in Git

この記事では、次の項目が扱われます。

If you're cloning GitHub Enterprise Server repositories using HTTPS, we recommend you use GitHub CLI or Git Credential Manager (GCM) to remember your credentials.

Tip: If you clone GitHub Enterprise Server repositories using SSH, then you can authenticate using an SSH key instead of using other credentials. For information about setting up an SSH connection, see "Generating an SSH Key."

GitHub CLI

GitHub CLI will automatically store your Git credentials for you when you choose HTTPS as your preferred protocol for Git operations and answer "yes" to the prompt asking if you would like to authenticate to Git with your GitHub Enterprise Server credentials.

  1. Install GitHub CLI on macOS, Windows, or Linux.
  2. In the command line, enter gh auth login, then follow the prompts.
    • When prompted for your preferred protocol for Git operations, select HTTPS.
    • When asked if you would like to authenticate to Git with your GitHub Enterprise Server credentials, enter Y.

For more information about authenticating with GitHub CLI, see gh auth login.

Git Credential Manager

Git Credential Manager (GCM) is another way to store your credentials securely and connect to GitHub over HTTPS. With GCM, you don't have to manually create and store a personal access token, as GCM manages authentication on your behalf, including 2FA (two-factor authentication).


For more information or to report issues with GCM, see the official GCM docs at "Git Credential Manager."