The problem with Git is "make sure the correct access rights and the repository exists."

Source: Internet
Author: User
Tags ssh

For the git commit has been very cautious, feel accidentally will step on the inexplicable pit.


It's not,


One day commit encounters the on branch master nothing to commit (working directory clean)


A look at the meaning. Is your branch clean?


Clean? Excuse me?


Then GIT push Origin master, a long wait for the pop-up fail:#¥%@ (omitted here, we value points)


Please make sure the correct access rights and the repository exists.


Then Google a bit, the original is SSH key has a problem, not connected to the server ~ ~

And then I started a dead end.



See a lot of answers, found that the writing is not very complete, their own east groping West groping done, afraid to forget, record


1, first I have to re-set the identity of the name and mailbox in Git (because I forgot to set what, because of the hole) into the folder to be submitted (because directly open git Bash, in the absence of a path, there is no!). Method! Change! The pit that I encountered when I first used git ... )

git config--global user.name "yourname"

git config--global user.email "[Email protected]"

Note: yourname is the name you want to set, [email protected] is the mailbox you want to set up.


2. Delete the. SSH folder (search for this folder directly) under the known_hosts (manually delete, do not need git)


3. Git input command

$ ssh-keygen-t rsa-c "[Email protected]" (please fill in the email address you set)


Then appears:

Generating public/private RSA key pair.

Enter file in which to save the key (/USERS/YOUR_USER_DIRECTORY/.SSH/ID_RSA):


Please press ENTER directly


Then the system will automatically generate two files under the. ssh folder, Id_rsa and Id_rsa.pub, with Notepad open id_rsa.pub


Copy all of your content


4. Open https://github.com/, login to your account, enter settings


Enter SSH settings




Paste the copy that you just copied in key


Click Add SSH Key,


Ok!


5. Enter the command in git:


ssh-t [email protected]


And then it jumps out a bunch of words.


Input command: Yes


Enter


Then you will be prompted to succeed.


Tears Cow Face ~ ~



Finally quit git to re-enter the path to submit it again ~ ~




Reproduced----51892864

The problem with Git is "make sure the correct access rights and the repository exists."

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.