git 中一些经常出现的错误的总结
程序员文章站
2022-04-06 18:48:25
...
git push 报错 error: failed to push some refs to ‘[email protected]:
$ git push -u origin master
To [email protected]:xxx/xxx.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to '[email protected]: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.
原因 github 远程仓库中readme.md文件不在本地仓库中
解决方法$ git pull –rebase origin master
错误提示:fatal: remote origin already exists.
这个错误的原因是remote origin already exists ,是远程的链接已经存在
解决的办法是先使用 git remote rm origin,再在把要修改的东西输入即可
在mac中找不到.ssh文件的时候可以使用cat或者vim 命令行来查看要查看的文件的内容
可以参考web
本地生成MAc ssh key 的方法
1. 查看秘钥是否存在
打开终端查看是否已经存在SSH**:cd ~/.ssh
如果没有**则不会有此文件夹,有则备份删除, 也可以直接删除,
2.生成新的秘钥, 命令如下
$ssh-****** -t rsa -C "[email protected]"
你需要把邮件地址换成你自己的邮件地址,然后一路回车,使用默认值即可,因为这个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 [email protected].com
如果服务器端需要公钥, 直接把.ssh目录下的id_rsa.pub配置即可, id_rsa为私钥一定要保密!!!!
参考具体得到
mac生成ssh keys的方法
上一篇: Spring Boot外部配置
下一篇: Oracle 数组的写法