failed to push some refs to 'git@github.com:RocsSun/mytest.git
Git推送到GitHub仓库失败
使用Git将文件推送至GitHub的远程仓库时,报错failed to push some refs to 'git@github.com:RocsSun/mytest.git'
Roc@DESKTOP-AF552U2 MINGW64 /e/note (master)
$ git remote add origin git@github.com:RocsSun/mytest.gt
Roc@DESKTOP-AF552U2 MINGW64 /e/note (master)
$ git push -u origin master
Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts.
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Roc@DESKTOP-AF552U2 MINGW64 /e/note (master)
$ git remote add origin git@github.com:RocsSun/mytest.git
fatal: remote origin already exists.
Roc@DESKTOP-AF552U2 MINGW64 /e/note (master)
$ git remote rm origin
Roc@DESKTOP-AF552U2 MINGW64 /e/note (master)
$ git remote add origin git@github.com:RocsSun/mytest.git
Roc@DESKTOP-AF552U2 MINGW64 /e/note (master)
$ git push -u origin master
To github.com:RocsSun/mytest.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:RocsSun/mytest.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.
Roc@DESKTOP-AF552U2 MINGW64 /e/note (master)
$ git push origin master
To github.com:RocsSun/mytest.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:RocsSun/mytest.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.
Roc@DESKTOP-AF552U2 MINGW64 /e/note (master)
$ git remote rm origin
大概原因就是 意思是本地和远程的文件应该合并后才能上传本地的新文件
1、先拉下来,会自动合并的(不用操心)
git pull origin master
2、再上传
git push -u origin master
成功解决问题
failed to push some refs to 'git@github.com:RocsSun/mytest.git的更多相关文章
- error: failed to push some refs to 'https://github.com/username/python.git'
解决error: failed to push some refs to 'https://github.com/bluepen/python.git' 当我们在使用git工具上传我们自己的代码时,可 ...
- 错误:error: failed to push some refs to 'https://github.com/pzq7025/KG.git'的解决办法
一.问题在进行[git push orgin master]的时候出现如下错误 ! [rejected] master -> master (non-fast-forward) error: f ...
- git上传文件夹报错: ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://github.com/taminachen/rjxm.git' hint: Updates were rejected because the remote contains work
使用git上传本地文件夹到远程仓库,使用如下命令:git push -u origin master时报错 原因是在GitHub创建仓库时创建了readme文件,但是本地没有这个文件,造成本地目录与远 ...
- git 本地推送远程仓库报错: error: failed to push some refs to 'https://github.com/yangtuothink/mxonline.git'
报错现象 添加远程仓库后 推送代码的时候报错 报错分析 远程代码和本地代码不匹配问题 远程初始仓库的创建有些默认 的 README什么的本地是没有的 需要先同步后再上传 报错解决 git push - ...
- git/github error: failed to push some refs to 'https://github.com/shenhaha/cloudletter.git'
git 提交代码到github上报如下错误 报错分析: 解决方法: 关闭这两个设置 再次提交代码 success
- git 解决 error: failed to push some refs to 'https://github.com/xxxx.git'
在github远程创建仓库后, 利用gitbash进行提交本地文件的时候出现如下错误 [root@foundation38 demo]# git push -u origin master Usern ...
- git 报错:error: failed to push some refs to 'https://github.com/Anderson-An/******.git'(已解决)
提交push 报错: $ git push origin masterTo https://github.com/Anderson-An/******.git ! [rejected] master ...
- git push ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com/Operater9/guest' hint: Updates were rejected because the tip of your current bra
推送本地代码到github报错 git push报错 ! [rejected] master -> master (non-fast-forward) error: failed to push ...
- failed to push some refs to 'https://gitee.com/ftl_663/java-shop.git'
1.git init 2.git add . 3.git commit -m "init" 4.git remote add origin https://gitee.com/ ...
随机推荐
- anaconda下jieba和wordcloud安装
1.在anaconda交互环境下安装jieba,输入命令: pip install jieba 2.在https://pypi.python.org/pypi/wordcloud下载wordclou ...
- vue中使用base64进行加解密
vue进行Base64加解密 背景 项目中需要对特殊字符进行处理,避免json和数据库的特殊字符(""等)冲突,刚好学了信息安全,干脆整个加解密,wkk.. 使用步骤 打开dos, ...
- 用SufaceGO加微软全家桶做个遥控车(一)
作为一个dotnet技术的新手我是不好意思写帖子的,原因就是本人技术太水了,写出的帖子肯定会让人笑话.所以这次我是厚着脸皮写出这个帖子的,希望大佬们轻喷了.我的目标就是用SurfaceGo实现一个和我 ...
- Project Euler 37 Truncatable primes
题意:3797有着奇特的性质.不仅它本身是一个素数,而且如果从左往右逐一截去数字,剩下的仍然都是素数:3797.797.97和7:同样地,如果从右往左逐一截去数字,剩下的也依然都是素数:3797.37 ...
- [USACO08FEB]修路Making the Grade 动态规划
对的\(n^3\)的程序调了一个月了,惊了... HSZ学oi\(\Longleftrightarrow\)闭眼学oi 要不是翻旧账还看不见.. 这是有\(n^2\)做法的. 参见LYD的书P244 ...
- 正则表达式和豆瓣Top250的爬取练习
datawhale任务2-爬取豆瓣top250 正则表达式 豆瓣250页面分析 完整代码 参考资料 正则表达式 正则表达式的功能用于实现字符串的特定模式精确检索或替换操作. 常用匹配模式 常用修饰符 ...
- 2019-03-25 SQL SET ANSI_NULLS /SET QUOTED_IDENTIFIER /SET NOCOUNT ON
use database go /**当 SET ANSI_NULLS 为 ON 时,即使 column_name 中包含空值,使用 WHERE column_name = NULL 的 SELECT ...
- openstack通过Network Namespace和iptables实现租户私有网络互訪和L3路由功能
安装架构介绍 本文旨在通过自己搭建类似neutron (openvswitch + gre) 实现SDN 的环境,学习了解其工作原理,模拟核心原理.比方:同一租户自己定义网络 instance 互通, ...
- PHP别名引用错误:“The use statement with non-compound name … has no effect”
别名概述 PHP5.3+支持命名空间:namespace,命名空间的一个重要功能是能够使用别名(alias)来引用一个符合规则的名字. 命名空间支持3中形式的别名引用(或称之为引入)方式:类(clas ...
- Unreal Engine 4 C++ 为编辑器中Actor创建自己定义图标
有时候我们创建场景的时候,特定的Actor我们想给它一个特定的图标,便于观察.比方这样: 实现起来也非常easy.须要编写C++代码: 我们创建一个Actor,叫AMyActor.它包括一个Sprit ...