SSH で GitHub Enterprise Server リポジトリをクローンする場合、他の認証情報ではなく SSH キーで認証します。 SSH 接続のセットアップについては「SSH キーを生成する」を参照してください。
参考:
- osxkeychain 認証情報ヘルパーを利用するには、Git 1.7.10 以降が必要です。
- Homebrew を使って Git をインストールした場合、
osxkeychain helperはインストール済みです。 - Mac OS X 10.7 以降を実行しており、Apple の Xcode コマンドラインツールで Git をインストールした場合、
osxkeychain helperは インストールした Git に含まれています。
Git および osxkeychain helper をインストールし、Git に osxkeychain helper の利用を指示します。
-
Git および
osxkeychain helperがインストールされているか、以下のコマンドで確認します:$ git credential-osxkeychain # Test for the cred helper > Usage: git credential-osxkeychain <get|store|erase> -
osxkeychain helperがインストールされておらず、OS X バージョン10.9以降を実行している場合は、Xcode コマンドラインツールの一部としてダウンロードするよう求められます。$ git credential-osxkeychain > xcode-select: note: no developer tools were found at '/Applications/Xcode.app', > requesting install. Choose an option in the dialog to download the command line developer tools.または、Homebrew を使用して Git と
osxkeychain helperをインストールします。$ brew install git -
グローバルな
credential.helperconfig を使用してosxkeychain helperを使用するよう Git に指示します。$ git config --global credential.helper osxkeychain # Set git to use the osxkeychain credential helper
認証が必要な HTTPS URL を次にクローンするときに、ユーザ名とパスワードの入力を求められます。 Gitがパスワードを求めてきたときは、代わりに個人アクセストークン(PAT)を入力してください。パスワードベースのGitの認証は非推奨であり、PATを利用する方がセキュアです。詳しい情報については「個人アクセストークンの作成」を参照してください。
認証に成功すると、認証情報は macOS のキーチェーンに保存され、HTTPS URL をクローンするたびに使用されます。 認証情報を変更しない限り、今後は Git で認証情報を入力する必要はなくなります。
ヒント: 認証情報ヘルパーを利用するには、Git 1.7.10 以降が必要です。
Git for Windows など、ネイティブ Git シェルをインストールすることもできます。 Git for Windows では、以下のコマンドを実行すると認証情報が保存されます:
$ git config --global credential.helper wincred
ヒント: 認証情報ヘルパーを利用するには、Git 1.7.10 以降が必要です。
認証情報ヘルパーを有効化し、Git が任意の時間、メモリにパスワードを保存できるようにしてください。 デフォルトでは、Git はパスワードを 15 分間保存します。
- ターミナルに、以下を入力します。
$ git config --global credential.helper cache # Set git to use the credential memory cache - パスワードのキャッシュがタイムアウトする時間を変更するには、以下のように入力します:
$ git config --global credential.helper 'cache --timeout=3600' # Set the cache to timeout after 1 hour (setting is in seconds)
For more options for storing your credentials on Linux, see Credential Storage in Pro Git.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
