xxx did not match any file(s) known to git
切换分支的时候,报了标题这么个错误,error: pathspec ''xxx did not match any file(s) known to git.

看见不能切换分支,我首先 git status 查看了一下当前状态,如下图

然后,就会发现,其实我的这个错误非常明显,就是在我的 beat 分支下有文件修改,所以切换不了。ok,解决方法:
- 如果修改的这些文件没什么用,完全可以删除。(我这儿的这些文件就是 mac 自动生成的,完全就可以使用这种方法)
rm -rf img/newIndex/.DS_Store img/newIndex/mobile/.DS_Store .DS_Store img/.DS_Store
- 根目录下添加
.gitignore文件,将.DS_Store文件忽略即可
我这儿问题比较简单。接下来,记录一下此类问题的其他解决方案。参考了文章
## 清除缓存
git rm -r --cached .
## git add
git add .
## git commit
git commit -m "hopefully fixed pathspec error"
xxx did not match any file(s) known to git的更多相关文章
- git切换分支报错:error: pathspec 'origin/XXX' did not match any file(s) known to git
项目上有一个分支test,使用git branch -a看不到该远程分支,直接使用命令git checkout test报错如下: error: pathspec 'origin/test' did ...
- Error: pathspec '*' did not match any file(s) known to git.
git切换分支报错 error: pathspec 'develop' did not match any file(s) known to git. 解决办法如下: plumm@MACY-PC MI ...
- Git使用之(pathspec master did not match any file(s) known to git)
一 问题概述 今天在工作中遇到一个问题,使用很久的一个local git repository,里面只有develop分支,那么现在想将分支切换到master分支,问题来了,在切换到master分支时 ...
- error: pathspec 'master' did not match any file(s) known to git.
问题描述: 在远程服务器上新建裸仓库git --bare init : git clone裸仓库到本地: 本地新建并切换分支xccdev,git checkout -b xccdev: 从xccde ...
- git commit 提交不了 error: pathspec 'project'' did not match any file(s) known to git.
1. 问题--使用git将代码提交到码云,使用到以下命令时: git commit -m 'init project' # 报错 error: pathspec 'project'' did not ...
- git——创建分支后,切换分支报错(error: pathspec 'master' did not match any file(s) known to git)
error: pathspec 'master' did not match any file(s) known to git 解决办法: 1.查看分支 git branch -a 2.获取所有分支 ...
- svn:Repository UUID 'XXX' doesn't match expected UUID 'YYY'
About a month ago, CodePlex have upgraded their TFS servers to to TFS 2010. While this transition wa ...
- [iOS] file patterns: The `public_header_files` pattern did not match any file.
由于之前集成私有pod,遇到问题, 默认的头文件目录设置为:s.public_header_files = ‘Pod/Classes/**/*.h’:但是如果Classes目录中,你的代码文件夹层次结 ...
- RLException: XXX is neither a launch file in package XXX nor is XXX a launch file name问题解决
在运行roslaunch时出现了类似下面的错误: RLException: XXX is neither a launch file in package XXX nor is XXX a launc ...
随机推荐
- 算法提高 P0102
用户输入三个字符,每个字符取值范围是0-9,A-F.然后程序会把这三个字符转化为相应的十六进制整数,并分别以十六进制,十进制,八进制输出,十六进制表示成3位,八进制表示成4位,若不够前面补0.(不考虑 ...
- Piggy-Bank HDU - 1114
Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. ...
- SpringMVC之JSON交互
#什么是json? json是一种用于储存数据格式,是js脚本语言的子集. #json的作用? 它可以传递对象.数组等数据结构.如果是单个数据,则要用数组,不用对象,因为对象都是键值对的 方式去存储, ...
- php stomp.dll 下载地址
http://pecl.php.net/package/stomp/1.0.9/windows 查看方法,打开phpinfo
- 利用JQuery Mobile开发web app
什么是web app web app 是基于web的应用程序,是针对移动设备优化后的web站点,它具有 开发成本低——采用web开发技术,不需要考虑跨平台以及底层适配问题: 升级简单——不需要通知用户 ...
- phpstudy手动把mysql数据库从5.5.56升级到5.6.41
查看mysql版本: mysql> select version(); 1.关闭mysql,把原来的D:/phpStudy/PHPTutorial/mysql改名为MySQL_5.5.53作为备 ...
- linux 中部署 rsync 实现文件远程备份及 同步
客户端:数据源:服务端:数据接收方 rsync官方文档:https://www.samba.org/ftp/rsync/rsync.html 手动测试用“通过远程外壳访问"里的语法: 参考1 ...
- python使用pip下载模块
举例下载串口模块pyserial: 下载安装了python之后,打开cmd,在python的安装目录里,搜索pip,把pip3.7.exe拖进cmd,然后输入pip3.7.exe install py ...
- 探究is与==的区别
1.is 和 ==的区别: 主要参考内存地址: 部分字符串和数字有固定的小数据池: 比如: a="abc" a1="abc" print(id(a),id(a ...
- C# 监控代码执行效率
System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); stop ...