git submits remote error [rejected] Master--master (fetch first)

Source: Internet
Author: User

1 download git for Windows first

Then always click Next to install.

2 after installation, select Git GUI. Generate SSH link git public key.

You can also use the command:

$ ssh-keygen-t rsa-c "[Email protected]"

then enter the password.

Suggested in the first way. The second kind of online says yes, but I didn't make it.

then enter the password.

3 Add a public key to open source China, or GitHub

Create a new public key in open source China and copy the contents of the id_ras_pub in the. SSH folder to the text box, where the title is optional.

4 Test Links:

Input command: $ ssh-t [email protected]

Then enter Yes

If successful, you can see your user name and mailbox.

Error can be tested: $ SSH-TV [email protected]

5 Setting the user name and mailbox

$ git config user.name "you name"

$git config user.email "[email protected]"

6 then create a project in Web open source China.

7 Test Upload file

To create a folder, you need the same name as the projexct you created.

mkdir Hello

CD Hello

Git init

Touch README

git add README

Git commit-m ' frist commit '

8 Submit

git remote add test [email protected]:web user name/hell.git

git push-u Test Master

If there is an error in the report:

to [email protected]:yangzhi/hello.git! [Rejected]        Master-to-master (fetch first) error:failed to push some refs to ' [email protected]:yangzhi/hello.git ' hint:updates wer E rejected because the remote contains work, which you dohint:not has locally. This was usually caused by another repository pushinhint:to the same ref. Want to first merge the remote changes (e.g.hint: "Git pull") before pushing Again.hint:See the ' Note about fast- Forwards ' in ' git push--help ' for details.

You can enter:

Git push-f

Okay, OK.

10 Cloning Code

git clone [email protected]: User name/project name. Git

Source: http://www.xuebuyuan.com/651322.html

git submits remote error [rejected] Master--master (fetch first)

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.