user1443098
user1443098

Reputation: 7625

github permission denied to push to my own repo

Recently I created an empty repos on github and cloned it to my laptop. I wrote some stuff and wanted to push it to the github repos, so I committed locally then entered

git push origin master

That produced an error message:

Fatal: HttpRequestException encountered. An error occurred while sending the request. Username for 'https://github.com': xxxxx Password for 'https://[email protected]': remote: Permission to xxxxx/yyyyy.git denied to xxxxx. fatal: unable to access 'https://github.com/xxxxx/yyyyy.git/': The requested URL returned error: 403

Where "xxxxx" is my username on github and yyyyy is my project (still empty!)

So, what am I missing? What do I need to do to push to my own repos on github?

Upvotes: 1

Views: 3358

Answers (2)

user1443098
user1443098

Reputation: 7625

Last time I tried this, the popup gui prompted me for the code sent to my phone. That solves the problem for now.

Upvotes: 0

ash
ash

Reputation: 5529

If you're using 2-factor authentication, you need to set up a personal access token to use instead of your password when pushing over HTTPS. In your account settings, go to Developer settingsPersonal access tokens and generate a token with repo access, then use that instead of your password.

Alternatively, you can set up an SSH key and push over SSH, which I find more convenient.

Upvotes: 2

Related Questions