remote: HTTP Basic: Access denied. If a password was provided for Git authentication, the password was incorrect or you're required to use a token instead of a password. If a token was provided, it was either incorrect, expired, or improperly scoped. See https://gitlab.com/help/topics/git/troubleshooting_git.md#error-on-git-fetch-http-basic-access-denied fatal: Authentication failed for 'https://hoge.com/hoge/hoge.git/'
gitを使うパソコンごとにトークンを作って、そのトークンをGitLabにログインして登録する必要があるようだ。 2026/4にこのエラーが出るようになったが、それまではパスワードでpullやpushができていた理由は不明。
ssh-keygen -t ed25519 をやると
~/.ssh/id_ed25519(秘密鍵) ~/.ssh/id_ed25519.pub(公開鍵)ができる。
cat ~/.ssh/id_ed25519.pub で公開鍵を表示して、コピペしておく。
ssh -T git@gitlab.com
Are you sure you want to continue connecting (yes/no)? → yes
成功した場合:Welcome to GitLab, @ユーザー名!
git remote set-url origin git@gitlab.com:gthmhk/gthmhk.git git remote -v
これで、pullやpushをやって、パスワードを聞かれなければ成功。