GitHub Enterprise - remote: Password authentication is not available for Git operations.
Problem
While using GitHub Enterprise at work, an access key expired, and the following error occurred when trying to clone a repository.
% git clone https://git.devkuma.com/devkuma/devkuma-hugo-blog.git
Cloning into 'devkuma-hugo-blog'...
remote: Password authentication is not available for Git operations.
remote: You must use a personal access token or SSH key.
remote: See https://git.devkuma.com.com/settings/tokens or https://git.devkuma.com/settings/ssh
fatal: unable to access 'https://git.devkuma.com/devkuma/devkuma-hugo-blog.git/': The requested URL returned error: 403
The URL above was changed for security reasons. The actual URL is different.
Solution
Create a new token from Personal access tokens in GitHub, then clone again by entering a command like the following.
git clone https://<user-name>:<git-token>@<github-path.git>
An actual command looks like this.
% git clone https://devkuma:ghp_eEREEeeQW2405408o1EQJIJegeiD332jtdfF@git.devkuma.com/devkuma/devkuma-hugo-blog.git
Cloning into 'devkuma-hugo-blog'...
remote: Enumerating objects: 2529, done.
remote: Counting objects: 100% (886/886), done.
remote: Compressing objects: 100% (347/347), done.
remote: Total 2529 (delta 246), reused 850 (delta 236), pack-reused 1643
Receiving objects: 100% (2529/2529), 311.62 KiB | 770.00 KiB/s, done.
Resolving deltas: 100% (763/763), done.
If the repository has already been cloned, you can change only the URL setting as follows.
git remote set-url origin https://devkuma:ghp_eEREEeeQW2405408o1EQJIJegeiD332jtdfF@git.devkuma.com/devkuma/devkuma-hugo-blog.git