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. 错误处理办法相关推荐

  1. error: src refspec master does not match any. 错误的解决办法

    文章目录 问题的内容: 解决办法: 总结: 在使用git bash指令将项目上传到github时,总是遇到一些错误无法解决. 下面是我遇到的一个问题 error: src refspec master ...

  2. 向远程提交分支的时候error: src refspec master does not match any错误

    报错代码: 报错代码:git push -u origin dev #向远程仓库分支推送报错 error: src refspec sablier does not match any #错误提示 原 ...

  3. 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 ...

  4. Git:错误:error:src refspec master does not match any

    新建立了一个远程仓库,想着把项目放上去.于是在项目目录上: git init 然后就添加远程库 git remote add origin xxxx.git 然后就想push: git push -u ...

  5. 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 ...

  6. 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 ...

  7. 解决git时出现error: src refspec master does not match any问题

    问题复现: 今天在使用gitee创建仓库后上传写好的代码时报错 在远程关联仓库后无法正常推送 键入下图代码时报错error: src refspec master does not match any ...

  8. git push 报错 error: src refspec master does not match any 解决

    真是TN的邪了门了,今天在Gitee上创建了一个新项目,然后要把本地的代码push上去时,报了如下错误: ➜ *** git:(main) git push -u origin "maste ...

  9. git push的时候报错:error: src refspec xxxxx does not match any. 错误原因和解决方法

    先说一下自己的修改经历 : 我本身想push到的是一个master的分支bugfix/V1120 然而当我执行 git push origin bugfix/V1120 报错 error: src r ...

最新文章

  1. 对于二叉树三种非递归遍历方式的理解
  2. Linux内核网络丢包查看工具dropwatch的安装和使用
  3. python学到什么程度可以做兼职-Python学到什么程度就可以找工作?
  4. 217. Contains Duplicate
  5. linux sftp自动输入密码,linux下实现sftp自动登录。
  6. mustache 模板使用
  7. osgearth_annotation示例
  8. Linux find+rm -rf 执行组合删除
  9. php截取字符串,无乱码
  10. javascript设计模式实践之策略模式--输入验证
  11. C#andSql获取当前日期格式
  12. github客户端使用简易教程
  13. 让CI框架支持traits新特性
  14. 如何通俗的理解机器学习中的VC维、shatter和break point?
  15. 腾讯云数据库团队:MySQL AHI 实现解析
  16. VS2010“未能正确加载包”问题解决方法小汇
  17. 微信公众号入门详细教程
  18. 三星Galaxy S22、三星Galaxy22+和三星Galaxy22 Ultra区别
  19. StarRocks Contributor 人数破百,极速统一,你我协力
  20. yum 私有仓库搭建

热门文章

  1. mysql 查询正在执行的事务以及锁 常用的sql语句
  2. ROS:ubuntu-Ros使用OrbSLAM
  3. andorid 查看OpenCv Mat的Debug信息
  4. PythonOpencv-分类器—SVM,KNearest,RTrees,Boost,MLP
  5. 什么是 Webpack?【Webpack Book 翻译】
  6. mysql的分库分表
  7. 【华为HCNA】访问控制列表ACL实例配置
  8. 微软反垄断案新突破 Win10系统或需剥离可信计算
  9. BigDecimal加减乘除运算
  10. 【java设计模式】迭代子模式