git push出错: src refspec dev/xxx does not match any

使用如下命令gitp push出错:

git push origin 远端分支名

git push origin dev/xxxx
error: src refspec dev/xxxx does not match any
error: failed to push some refs to 'https://git.woa.com/.....'

解决方案 1: 

git push origin 本地分支名:远端分支名

解决方案2:

如果本地分支已经关联了远程分支就使用下面命令直接push即可。

git push .

原理:

疑问:

为什么之前同样的本地分支和远程分支使用git push origin 远端分支名 就没问题?

可能是因为本地有多个head?git commit 之后没有push然后又git reset到别的commit。

相关推荐

  1. 建立数据库连接时出错

    2024-03-22 18:58:03       35 阅读
  2. Python安装第三方库出错

    2024-03-22 18:58:03       37 阅读
  3. 代码编译出错可能的原因

    2024-03-22 18:58:03       66 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-22 18:58:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-22 18:58:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-22 18:58:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-22 18:58:03       20 阅读

热门阅读

  1. 回文素数

    2024-03-22 18:58:03       21 阅读
  2. 蓝桥杯 完全二叉树的权值

    2024-03-22 18:58:03       24 阅读
  3. 【医疗-单位计算】

    2024-03-22 18:58:03       21 阅读
  4. CAS(compare and swap)算法

    2024-03-22 18:58:03       20 阅读
  5. 【NLP5-RNN模型、LSTM模型和GRU模型】

    2024-03-22 18:58:03       17 阅读
  6. tomcat安装及配置教程

    2024-03-22 18:58:03       22 阅读