iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🦔

How to Fix "Authentication failed" for Private Repositories

に公開

This is a note on how to handle situations where repositories are split during development and some are set as private repositories.

It happened all of a sudden.
While doing things as usual...

$ bundle install

Fetching gem metadata from https://rubygems.org/........
Fetching https://github.com/xxxxxxxxxx.git

remote: Repository not found.
fatal: Authentication failed for 'https://github.com/xxxxxxxxxx.git/'

Retrying `git clone --bare --no-hardlinks --quiet -- https://:@github.com/xxxxxxxxxx.git
If this error persists you could try removing the cache directory '/Users/xxxxxxxxxx' ...

??
It says "Authentication failed," so there is a failure regarding authentication.

Is it because I regenerated my Personal Access Token since it had expired?
This happened when I was rebuilding my development environment.

I just needed to set the authentication information again.

$ bundle config set --global https://github.com/xxxxxxxxxx.git <GitHub user_name>:<Personal access token>

This should work (hopefully).

Discussion