If you have SSH keys added to your GitHub account you can switch your repos to use SSH
- Disable
credential.helper
- Check if
credential.helper
is set to anythinggit config -l --global
- Unset
credential.helper
withgit config --global --unset credential.helper
- Verify URLs are as expected. Then add a
-i
tosed
to update in place(in the.git/config
file)
find . -type f -path '*.git*/*' -name 'config' | xargs -I {} sed 's/https:\/\/github.com\//git@github.com:/g' {} | grep url
- ❗️ Update
.git/config
files
Below command will update the
.git/config
files in place. Please make sure you understand the below command before running it.
find . -type f -path '*.git*/*' -name 'config' | xargs -I {} sed -i '' 's/https:\/\/github.com\//git@github.com:/g' {}
gh
cli:gh config set git_protocol ssh --host github.com