Home > database >  failed to push the branch to the remote repository
failed to push the branch to the remote repository

Time:06-29

Hello I am trying to push an branch in visual studio there is an error : enter image description here

When I tried the following windows is shown:

enter image description here

and

enter image description here

I have inserted my credentials but without success.

Is it other way o solve this issue?

CodePudding user response:

You might as well using the git cli.

First you need to create an SSH Key.

--- Linux :

ssh-keygen -t rsa -b 4096 -C "[email protected]"

press 'Enter' a a couple of times after that you should get a success message. copy your id_rsa.pub

cat ~/.ssh/id_rsa.pub

--- Windows : Create folder if exists, and create SSH Key

mkdir /Users/username/.ssh && cd /Users/username/.ssh
ssh-keygen -t rsa -b 4096 -C "[email protected]"

Copy the code was outputed.

Go to you github page and press 'Settings' => 'SSH and GPG Keys' Click 'New SSH Key' in the test area under 'Key', paste in your SSH key.

CodePudding user response:

You shoul generate an application password (access token) in GitHub and filling it in instead of your password and it will works ! Doc here

  • Related