1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CodeCommitの認証エラー(403)で躓いたのでドキュメントを読んで対応したときの作業ログ

Posted at

Github でソースコードを管理している、サーバー環境は AWS で、 CodeCommit へ push したら CodePipelineが動くよう設定されている。
という状況で、CodeCommitにpush(もpullも)できず認証エラーで悩んだときの作業記録

AWSのドキュメントを読んだ

$ git config -l --show-origin |grep osxkeychain
file:/usr/local/etc/gitconfig	credential.helper=osxkeychain

gitconfigの親玉が見つかったので、開いて編集

[credential]
#       helper = osxkeychain

helperの設定をコメントアウトした。

さらに Keychain Access.app で CodeCommit の該当のエントリー(有効期限が切れている)を削除。

これで CodeCommit へは gitアクセスできるようになった。

しかし代わりに Githubへgitコマンドでアクセスすると、毎度ユーザー名とパスワードを聞かれるようになってしまった。
さすがにそれは煩わしい。

~/.gitconfig へこれを追加

[credential "https://github.com"]
   helper = osxkeychain

無事、いままでどおりにgithubを使えるように戻った。

個人的にはGitlabも使うのでgitlab.comへも同じように osxkeychain を使うように設定しておいた。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?