Ryan
Ryan

Reputation: 151

Pushing to GitHub without a key

I am using GitHub and C9 on a work computer and but GitHub will stop reading my SSH key after a few hours. IDK if it is because I am using my work computer (job is not currently programming), but is there a way I can push my code without an SSH key

Upvotes: 1

Views: 988

Answers (1)

VonC
VonC

Reputation: 1329592

First, check that your remote URL is indeed an ssh one:

cd /path/to/my/local/cloned/repo
git remote -v

If it is ([email protected]:user/repo), check what ssh -Tv [email protected] returns.

If SSH does not work (because SSH port might be blocked at work), switch to an HTTPS URL:

git remote set-url origin https://github.com/user/repo

From there, make sure git config credential.helper does reference an helper (like "manager" on Windows), and you will be prompted for your GitHub account username/password at the first push. After that, your credentials will be cached.

Upvotes: 1

Related Questions