windows - git 命令在 Windows 命令行上工作,但在 Git Bash 终端中不工作
问题描述
我正在使用 Windows cmd 上的 git 命令处理远程存储库,它运行良好,但是在 git bash 终端中使用 git 命令时出现错误:
Your configuration specifies to merge with the ref 'refs/heads/feature/branch-name'
from the remote, but no such ref was fetched.
如何为 git bash 终端修复它?
解决方案
首先,在您的 git bash 会话中检查以下输出:
git branch -avv
git status
确保您所在分支的名称与远程分支的名称匹配,特别是考虑大小写(大写/小写),以防它在 CMD 会话中不敏感,而在 bash 会话中敏感。
请参阅此示例。
git checkout --track origin/branch
如果分支列表显示本地分支未链接到远程跟踪分支,那么,正如我在“[和之间的区别git checkout -b branch origin/branch][2]
”中记录的那样:
git branch -u origin/branch branch
推荐阅读
- c# - C# 性能分析器显示长时间暂停,无法从提供的数据中确定它是什么
- java - 仅使用线条和仿射变换来绘制多边形
- javascript - 具有相同字段的 Apollo GraphQL 内联片段错误
- angular - 如何将所有依赖项更新到特定版本
- rust - 如何使用 rusoto_s3 将 actix 多部分字段保存到 s3?
- android - EditText 和自定义类字段之间的双向数据绑定
- python - 如何使用 Beautiful Soup 和 Python 为 NASDAQ 网站中的表格提取 HTML 代码
- c++ - 创建一个执行 lambda 函数的函数。我必须分别处理 void 和 non void 吗?
- java - 为扫描仪创建一个专用类是一种有用的输入解决方案吗?
- ibm-cloud - 在 IBM Assistant 中如何通过 .csv 文件导入意图?我收到一个错误