git push -u origin main
error: src refspec main does not match any
error: failed to push some refs to 'https:

原因是没发现main分支,切换到main分支,再次测试即可

$ git checkout main
Switched to branch 'main'
Your branch is up to date with 'origin/main'

或者可以用git branch查看有哪些分支

查看本地分支

$ git branch
* mainmaster

查看远程分支

$ git branch -rorigin/mainorigin/master

查看所有分支,包括本地和远程

$ git branch -a
* mainmasterremotes/origin/mainremotes/origin/master

总结

  • 无法推送到某分支,先确认是否有该分支

src refspec main does not match any相关推荐

  1. error: src refspec main does not match any

    这种情况一般两种情况导致: 1.分支不存在 使用checkout创建对应分支 git checkout -b master 2.没有使用git add和git commit将文件添加至缓存 git a ...

  2. 遇到一个git的大坑 src refspec master does not match any error: failed to push some refs to

    今天本来想把内容上传到git仓库去,但是折腾了好久一直报错. 错误信息是这样的. error: src refspec master does not match any error: failed ...

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

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

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

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

  6. error: src refspec master does not match any. 错误处理办法

    2019独角兽企业重金招聘Python工程师标准>>> 本地仓库使用如下命令初始化: $ git init 之后使用如下命令添加远程库: $ git remote add origi ...

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

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

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

  9. src refspec xxx does not match any

    git pull orgin branch 报错:src refspec xxx does not match any 解决方案: git push origin HEAD:branch

最新文章

  1. html 表单内容怎么获取不到,jquery中formdate一直获取不到对象中的[0]的值 包括本身也是一个空的数据怎么办?...
  2. 三星在研发VR一体机?眼动追踪公司曝出原型机
  3. python开发面试问题及答案_前50个Python面试问题(最受欢迎)
  4. 修改db2管理服务器,创建DB2管理服务器的两种情况
  5. NumPy数值计算库-1
  6. 为了探究不同光照处理_初中化学 | 控制变量法与影响因素的探究
  7. cdr软件百度百科_什么是CDR软件?
  8. Flutter 旋转动画
  9. 微信开发者工具保存的时候,提示权限不足,选择以管理员的身份重试个人解决方法
  10. 什么是cc攻击以及个人网站遭到cc攻击的解决方法
  11. MySQL 系列(三)你不知道的 视图、触发器、存储过程、函数、事务、索引、语句
  12. [新闻]华为发布最高端核心路由器NE5000E集群系统
  13. Towards Causal Representation Learning
  14. echart饼图标签重叠_解决echarts中饼图标签重叠的问题
  15. 常用颜色RGB、灰度值
  16. pytorch 常用目标检测评价指标总结
  17. [转]Git详解之四 服务器上的Git
  18. Twitter 账号爬取
  19. 集成微透镜阵列的CMOS传感器分析
  20. 基于ARM Cortex-A8和Android 4.x的联动报警系统 (Android 、A8、Linux、驱动、NDK)

热门文章

  1. python训练过程是什么_学了这么久,你知道Python机器学习全流程是怎样的么?
  2. 创建ServerSocket出错Permission denied
  3. jts116_JTS T 116-2019水运建设工程概算预算编制规定.pdf
  4. 如何搭建克隆系统服务器,FOG Project网络克隆系统安装和搭建
  5. Android自定义事件总线,手写Android事件总线框架Eventbus(简易版)
  6. php wordpress乱码,PHP問題:基于WordPress的CMS网站在文章摘要末尾出现乱码
  7. 云服务器上部署pytorch,flask部署pytorch-服务端
  8. html api中文文档,Svelte API 中文文档 | Svelte 中文网
  9. python面对对象实验_Python面向对象实现方法总结
  10. 一台服务器上使用docker安装redis6.0.10一主两从以及哨兵模式