Git error resolution (git Shell under Windows version)

Source: Internet
Author: User
Tags git shell

The first question: how can I pull my local warehouse code to the GitHub site?

Git push Origin master

warning:permanently added ' github.com,192.30.255.112 ' (RSA) to the list of known hosts.
To Github.com:lanshanxiao/yunweather.git
! [Rejected] Master--master (fetch first)
Error:failed to push some refs to ' [email protected]:lanshanxiao/yunweather.git '
Hint:updates were rejected because the remote contains work the
Hint:not has locally. This was usually caused by another repository pushing
Hint:to the same ref. Want to first integrate the remote changes
Hint: (e.g., ' git pull ... ') before pushing again.
Hint:see the ' Note about Fast-forwards ' "Git push--help ' for details.

Git pull Origin Master

warning:permanently added ' github.com,192.30.255.112 ' (RSA) to the list of known hosts.
Remote:counting Objects:5, done.
Remote:compressing objects:100% (4/4), done.
Warning:no Common commits
Remote:total 5 (Delta 0), reused 0 (Delta 0), pack-reused 0
Unpacking objects:100% (5/5), done.
From Github.com:lanshanxiao/yunweather
* Branch Master--Fetch_head
* [New branch] master, Origin/master
Fatal:refusing to merge unrelated histories

Git push Origin Master

warning:permanently added ' github.com,192.30.255.112 ' (RSA) to the list of known hosts.
To Github.com:lanshanxiao/yunweather.git
! [Rejected] master, master (Non-fast-forward)
Error:failed to push some refs to ' [email protected]:lanshanxiao/yunweather.git '
Hint:updates were rejected because the tip of your current branch is behind
Hint:its remote counterpart. Integrate the remote changes (e.g.
Hint: ' git pull ... ') before pushing again.
Hint:see the ' Note about Fast-forwards ' "Git push--help ' for details.

The above executed three times, but all error, although pull down the remote repository code, but no

Git pull Origin master//merges local warehouse code and remote repository code

If you have the following error:

fatal:refusing to merge unrelated histories//description Local repository cannot be fused with remote warehouse code

To force the fusion to be allowed:

Git pull Origin master--allow-unrelated-histories

The second question: even though the SSH password has been added to GitHub, Permission denied (PublicKey) will still appear? You may not have the public key added to this machine

warning:permanently added ' github.com,192.30.255.112 ' (RSA) to the list of known hosts.
Permission denied (PublicKey).
Fatal:could not read from remote repository.

First, follow the steps on Baidu, the SSH password (C:\Users\ user name \.ssh\id_rsa.pub) in the password added to their own GitHub website, this can be Baidu.

Running GIT push Origin master again has the error above, and then the point is:

ssh-agent.exe//Running Agent

SSH-VT [email protected]

ssh-add-l//Small Letter L

Ssh-add

ssh-add-l//Small Letter L

The above command is to run SSH on the local computer and add the public key in.

Git ls-files//to view the files that have been submitted.

Git error resolution (git Shell under Windows version)

Related Article

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.