Skip to content

Instantly share code, notes, and snippets.

@format37
Created June 3, 2020 14:22
Show Gist options
  • Save format37/fb679260f1dda7865d93c264612ea6f4 to your computer and use it in GitHub Desktop.
Save format37/fb679260f1dda7865d93c264612ea6f4 to your computer and use it in GitHub Desktop.
git deploy key using
ssh-keygen -t rsa -b 4096 -C "format37@gmail.com"
/home/alex/.ssh/id_rsa_REPO_NAME
cat /home/alex/.ssh/id_rsa_REPO_NAME.pub
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa_REPO_NAME
@format37
Copy link
Author

format37 commented Aug 23, 2021

Git push requires username and password

A common cause is cloning using the default (HTTPS) instead of SSH. You can correct this by going to your repository, clicking "Clone or download", then clicking the "Use SSH" button above the URL field and updating the URL of your origin remote like this:

git remote set-url origin git@github.com:username/repo.git

You can check if you have added the remote as HTTPS or SSH using:

git remote -v

https://stackoverflow.com/questions/6565357/git-push-requires-username-and-password

@format37
Copy link
Author

format37 commented Sep 5, 2021

ssh
Too many authentication failures

nano ~/.ssh/config

set IdentitiesOnly=yes:

Host * 
       	IdentitiesOnly=yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment