While I was recently working on a new project, I ran into an issue that I hadn’t seen before (or at least hadn’t seen enough to be memorable):
⋟ git push Username for 'https://gitlab.com': JadoJodo Password for 'https://JadoJodo@gitlab.com':
Huh. I shouldn’t need to enter my GitLab login info. I wonder why it’s asking instead of using my SSH key. A quick search revealed… not much. After tweaking my search params, I was able to find a StackOverflow post that answered my questions:
Evidently, I had cloned my repo using the HTTPS git URL instead of the SSH one. This can be quickly fixed by running:
git remote set-url firstname.lastname@example.org:username/gitrepo.git
This tells git to switch to SSH and use your key instead of password authentication. Sweet!