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/ ...
随机推荐
- 路飞学城Python-Day96
51-数据库表关系之一对多 为什么有多表的概念? 一个Book有单表的时候只能查询Book表中的内容,要想查询更多的出版社的信息,需要再将单表的内容不断更新 导致单表会存储大量的重复的信息,浪费了大量 ...
- K3 新单到老单关联字段的添加
新单到老单字段的添加分为两种: 一种为文本字段信息的关联,新单与老单字段的信息均为文本字段: 另一种为基础资料信息的关联,新单与老单均为基础资料字段信息. K3 WISE 11.0中存储老 ...
- P1423 小玉在游泳
... 题目描述 小玉开心的在游泳,可是她很快难过的发现,自己的力气不够,游泳好累哦.已知小玉第一步能游2米,可是随着越来越累,力气越来越小,她接下来的每一步都只能游出上一步距离的98%.现在小玉想知 ...
- [luogu4037 JSOI2008] 魔兽地图 (树形dp)
传送门 Description DotR (Defense of the Robots) Allstars是一个风靡全球的魔兽地图,他的规则简单与同样流行的地图DotA (Defense of the ...
- 【hdu 6438】Buy and Resell
[链接] 我是链接,点我呀:) [题意] 有一个物品的价格在1..n这些位置各不相同. 你初始有无限的钱. 问你从1走到n. 你每次可以选择买入一个或者卖出一个该种物品(或啥都不做) 问你最后的最大利 ...
- Oracle学习总结(6)—— SQL注入技术
不管用什么语言编写的Web应用,它们都用一个共同点,具有交互性并且多数是数据库驱动.在网络中,数据库驱动的Web应用随处可见,由此而存在的SQL注入是影响企业运营且最具破坏性的漏洞之一. SQL注入基 ...
- BA-siemens-insight_designer不支持win7 64位操作系统
如果把insight安装在win7 64位操作系统中,在编辑图形界面的时候,designer会出现下面的错误对话框,侬还是老老实实的安装32位的系统吧!
- [Preference] How to avoid Forced Synchronous Layout or FSL to improve site preference
When tigger site updates the layout, it always follow this order: Javascript trigger style changes, ...
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第11章节--为Office和SP解决方式开发集成Apps 集成SP和Office App
BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第11章节--为Office和SP解决方式开发集成Apps 集成SP和Office App 你能够用两种 ...
- 【LeetCode-面试算法经典-Java实现】【033-Search in Rotated Sorted Array(在旋转数组中搜索)】
[033-Search in Rotated Sorted Array(在旋转数组中搜索)] [LeetCode-面试算法经典-Java实现][全部题目文件夹索引] 原题 Suppose a sort ...