Table of Contents
git push error error: failed to push some refs to 'git@github.com:
Error message: fatal: remote origin already exists.
When you can’t find the .ssh file in mac, you can use cat or vim command line to view it The content of the file to be viewed
Method to generate MAc ssh key locally
Home Web Front-end JS Tutorial Summary of some common errors in git

Summary of some common errors in git

Sep 26, 2017 am 09:56 AM
Appear Condition mistake


git push error error: failed to push some refs to 'git@github.com:

$ git push -u origin master
To git@github.com:xxx/xxx.git
 ! [rejected]        master -> master (fetch first)error: failed to push some refs to 'git@github.com:xxx/xxx.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Copy after login
原因 github 远程仓库中readme.md文件不在本地仓库中 
   解决方法
$ git pull –rebase origin master
$ git push -u origin master 
   可以参考
Copy after login

Error message: fatal: remote origin already exists.

The reason for this error is remote origin already exists, the remote link already exists
The solution is to use git remote rm origin first, and then enter what you want to modify

When you can’t find the .ssh file in mac, you can use cat or vim command line to view it The content of the file to be viewed

Method to generate MAc ssh key locally

1. 查看秘钥是否存在

打开终端查看是否已经存在SSH密钥:cd ~/.ssh如果没有密钥则不会有此文件夹,有则备份删除,   也可以直接删除,  

2.生成新的秘钥, 命令如下

$ssh-keygen -t rsa -C "youremail@example.com"你需要把邮件地址换成你自己的邮件地址,然后一路回车,使用默认值即可,因为这个Key仅仅用于简单的服务,所以也无需设置密码。

完成后会有如下显示

Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/你的电脑用户名/.ssh/id_rsa.
Your public key has been saved in /Users/你的电脑用户名/.ssh/id_rsa.pub.
The key fingerprint is:SHA256:5V6ZCQNS/3bVdl0GjGgQpWMFLazxTslnKbW2B1mbC+E example@qq.com如果服务器端需要公钥,  直接把.ssh目录下的id_rsa.pub配置即可, id_rsa为私钥一定要保密!!!!
Copy after login

The above is the detailed content of Summary of some common errors in git. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Unable to complete operation (Error 0x0000771) Printer error Unable to complete operation (Error 0x0000771) Printer error Mar 16, 2024 pm 03:50 PM

Unable to complete operation (Error 0x0000771) Printer error

Revealing the causes of HTTP status code 460 Revealing the causes of HTTP status code 460 Feb 19, 2024 pm 08:30 PM

Revealing the causes of HTTP status code 460

Windows Sandbox startup failed - Access Denied Windows Sandbox startup failed - Access Denied Feb 19, 2024 pm 01:00 PM

Windows Sandbox startup failed - Access Denied

How to solve computer broadband connection error code 651 How to solve computer broadband connection error code 651 Dec 24, 2023 am 11:19 AM

How to solve computer broadband connection error code 651

Solve the errors encountered when installing autocad in win11 Solve the errors encountered when installing autocad in win11 Dec 30, 2023 pm 03:23 PM

Solve the errors encountered when installing autocad in win11

Solution to Windows Update prompt Error 0x8024401c error Solution to Windows Update prompt Error 0x8024401c error Jun 08, 2024 pm 12:18 PM

Solution to Windows Update prompt Error 0x8024401c error

Troubleshooting Tomcat 404 Errors: Quick and Practical Tips Troubleshooting Tomcat 404 Errors: Quick and Practical Tips Dec 28, 2023 am 08:05 AM

Troubleshooting Tomcat 404 Errors: Quick and Practical Tips

The server encountered an error, 0x80070003, while creating a new virtual machine. The server encountered an error, 0x80070003, while creating a new virtual machine. Feb 19, 2024 pm 02:30 PM

The server encountered an error, 0x80070003, while creating a new virtual machine.

See all articles