dockerのubuntuからgit pushできない fatal: Authentication failed for 'https://github.com/username/reponame.git/'
原因
PATの期限切れだった。
他の環境(Github Actions上のubuntuやホストマシン上のrepo)からは、
pushできていたが、github actionsはpatに依存しないらしい、
ホストマシンはsshのためpat関係なく接続できていた。
対応
Expired on Mon, Jul 1 2024. みたいになっていたので、
PAT作り直して解決。
workflowなどにも作り直したものを登録。
調査内容
- https://github.com/username/reponame.git/ にアクセスできること確認
- git remote set-url origin https://x-access-token:pat@github.com/username/reponame.git のpat部分に心当たりのpatを試して同じエラー、passwordっぽい文字列を入れてpatへの誘導を出す
GIT_TRACE=1 GIT_CURL_VERBOSE=1 git push -u origin mainして中身の動きをみる(内容読むの面倒なのでchatgptで5行ごとに解説出力して参考に)