error: src refspec master does not match any. 错误处理办法
2019独角兽企业重金招聘Python工程师标准>>>
本地仓库使用如下命令初始化:
$ git init
之后使用如下命令添加远程库:
$ git remote add origin git@github.com:hahah/ftpmanage.git
然后使用
$ git push -u origin master
出现如下错误:
error: src refspec master does not match any. error: failed to push some refs to 'git@github.com:hahaha/ftpmanage.git'
原因:
本地仓库为空
决方法:使用如下命令 添加文件;
$ git add add.php addok.php conn.php del.php edit.php editok.php ftpsql.sql index.php$ git commit -m "init files"
之后在push过程中出现如下错误:
$ git push -u origin master Warning: Permanently added the RSA host key for IP address 'xx.xx.xxx.xxx' to the list of known hosts. To git@github.com:hahaha/ftpmanage.git! [rejected] master -> master (fetch first) error: failed to push some refs to 'git@github.com:hahahah/ftpmanage.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.
提示使用 git pull 之后在 push
使用如下命令解决:
$ git pull --rebase origin master warning: no common commits remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. From github.com:hahah/ftpmanage* branch master -> FETCH_HEAD* [new branch] master -> origin/master First, rewinding head to replay your work on top of it... Applying: init files
继续push,成功。
$ git push -u origin master Counting objects: 10, done. Delta compression using up to 2 threads. Compressing objects: 100% (10/10), done. Writing objects: 100% (10/10), 5.15 KiB | 0 bytes/s, done. Total 10 (delta 3), reused 0 (delta 0) To git@github.com:hahaha/ftpmanage.gita2b5c30..1044f15 master -> master Branch master set up to track remote branch master from origin.
转载于:https://my.oschina.net/cms2012/blog/1554424
error: src refspec master does not match any. 错误处理办法相关推荐
- error: src refspec master does not match any. 错误的解决办法
文章目录 问题的内容: 解决办法: 总结: 在使用git bash指令将项目上传到github时,总是遇到一些错误无法解决. 下面是我遇到的一个问题 error: src refspec master ...
- 向远程提交分支的时候error: src refspec master does not match any错误
报错代码: 报错代码:git push -u origin dev #向远程仓库分支推送报错 error: src refspec sablier does not match any #错误提示 原 ...
- Git——git push 错误[error: src refspec master does not match any]解决方案
问题描述 git push -u origin master error: src refspec master does not match any error: failed to push so ...
- Git:错误:error:src refspec master does not match any
新建立了一个远程仓库,想着把项目放上去.于是在项目目录上: git init 然后就添加远程库 git remote add origin xxxx.git 然后就想push: git push -u ...
- git push 失败出现error: src refspec master does not match any.解决方案
git push 失败出现error: src refspec master does not match any.解决方案 参考文章: (1)git push 失败出现error: src refs ...
- error: src refspec master does not match any error: failed to push some refs to ‘https://gitee.com/s
发现是默认建立的仓库是 main,而不是 master iot421@iot421deMac StarpPhone % git push origin master error: src refspe ...
- 解决git时出现error: src refspec master does not match any问题
问题复现: 今天在使用gitee创建仓库后上传写好的代码时报错 在远程关联仓库后无法正常推送 键入下图代码时报错error: src refspec master does not match any ...
- git push 报错 error: src refspec master does not match any 解决
真是TN的邪了门了,今天在Gitee上创建了一个新项目,然后要把本地的代码push上去时,报了如下错误: ➜ *** git:(main) git push -u origin "maste ...
- git push的时候报错:error: src refspec xxxxx does not match any. 错误原因和解决方法
先说一下自己的修改经历 : 我本身想push到的是一个master的分支bugfix/V1120 然而当我执行 git push origin bugfix/V1120 报错 error: src r ...
最新文章
- 对于二叉树三种非递归遍历方式的理解
- Linux内核网络丢包查看工具dropwatch的安装和使用
- python学到什么程度可以做兼职-Python学到什么程度就可以找工作?
- 217. Contains Duplicate
- linux sftp自动输入密码,linux下实现sftp自动登录。
- mustache 模板使用
- osgearth_annotation示例
- Linux find+rm -rf 执行组合删除
- php截取字符串,无乱码
- javascript设计模式实践之策略模式--输入验证
- C#andSql获取当前日期格式
- github客户端使用简易教程
- 让CI框架支持traits新特性
- 如何通俗的理解机器学习中的VC维、shatter和break point?
- 腾讯云数据库团队:MySQL AHI 实现解析
- VS2010“未能正确加载包”问题解决方法小汇
- 微信公众号入门详细教程
- 三星Galaxy S22、三星Galaxy22+和三星Galaxy22 Ultra区别
- StarRocks Contributor 人数破百,极速统一,你我协力
- yum 私有仓库搭建