During git push - Unable to access Fatal Error

While running git push origin master
I am getting below error.

remote: Permission to Sumanshu-Nankana/Docker.git denied to Sumanshu-Nankana.
fatal: unable to access ‘https://github.com/Sumanshu-Nankana/Docker.git/’: The requested URL returned error: 403

  1. Password and Username is correct (as it’s working on github.com)
  2. I tried with Public Access Token (because I have 2 Factor Auth enable)
  3. I am using https (so no ssh key concept)
  4. I am able to push using VS CODE , but unable to push using Terminal (getting this error first time - probably after enabling 2Factor Auth)

But with both password and token, I am getting same ‘Unable to access’, with token (I get some extra message as well i.e. The requested URL returned error: 403)

can anyone help me, what is wrong. Though I am

Did you make sure to give the PAT the necessary permissions when creating it?

1 Like

Hi a have same problem, unable to access when I use git push at command line. What PAT is? How can I give that permission (if that’s is the problem) after? Can I? Please help me, thanks

“PAT” is short for “personal access token”. The token is a long and complicated string that you can use similarly to a password. Here’s the documentation on how to create one: Creating a personal access token - GitHub Docs

If you already have PATs, you can see them on the Personal access tokens page in your settings. Click the one you want to edit and you should see (among other things) a list of scopes and a button to update the token below.

1 Like

Thanks for the reply. I will try. Can I use that token as a password at command line?

  1. augusztus 14., szombat dátummal Airtower via GitHub Support Community <githubcommunity@discoursemail.com> ezt írta:

Yes, see Using a token on the command line. That also has a link to how to cache the token (so you don’t have to enter it for every operation, only once in a while).

Usually it’s a good idea to store the token in a password manage. After all it purposefully isn’t easy to remember. :wink:

1 Like

Hi I still can’t log in, I made the token I got message
Hey Feri982!

A personal access token (Feri) with admin:repo_hook, delete_repo, and repo scopes was recently added to your account.
I’m confused, I used that long token as password and I tried with my old password I tried many options but I can see that as on picture. Attached

  1. augusztus 14., szombat dátummal Airtower via GitHub Support Community <githubcommunity@discoursemail.com> ezt írta:

It looks like the token is visible at the top of your photo. This forum is public, so you have shared the token with the whole world. You need to revoke the token now and generate a new one. :warning:

Other than that, it looks like you typed Username: Feri982 instead of Feri982 for your user name.

1 Like

okay i changed my token. other than i did not. when i used on prompt line hat command : git push “my git link”
Username: Feri982
Password: i hide my token
so after that i got that screen. now i upload to youtube how i did , if i did wrong please tell me which step is wrong. if anybody can send me step by step basic video how i need to do, i m confused.
here is the, and sorry for my bad English :slight_smile:

Huawei <82feri@gmail.com> ezt írta (időpont: 2021. aug. 14., Szo, 17:59):

I’m not sure what that that window is, maybe some GitHub integration that comes with Git for Windows? On Linux I get the command line prompt immediately.

What you do at the command line prompt looks correct in the video. In particular, unlike in the screenshot the password prompt now says Password for 'https://Feri982@github.com'. The part between https:// and @ needs to be your user name.

I just tried with my own username and PAT and it worked, so probably something goes wrong with copying the PAT. In the video it looks and sounds like you select and copy the token text. That can easily go wrong, for example if you accidentally copy a space next to the token, too, it won’t work.

There’s a little “clipboard” icon next to the token when you generate it: grafik Try clicking that instead to copy the token.

1 Like

Hi I did like copy paste with mouse and I did what you say tap the clipboard icon and paste.

And it still doesn’t work? That’s really odd! In that case I can only give the same advice as here, unfortunately:

1 Like

hi unfortunately that is not works, same as the other user what you sent me the link. how can i try with ssh? im very new i dont understand lots of things. how can i change https to ssh?

now succeded! i deleted my .git files from my pc, reinstalled the git program, make everything again, and now working. i just had 1 file to add and commit so wasnt a big deal. cheers my friend

1 Like