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 ...
随机推荐
- ui-router .state参数配置
.state('页面被引用时的变量名',{ template: '<h1>My Contacts</h1>',//被应用时插入的模板,状态被激活时,它的模板会自动插入到父状态对 ...
- OpenCV入门笔记(七) 文字区域的提取
https://blog.csdn.net/huobanjishijian/article/details/63685503 前面我们已经学了一些OpenCV中基本的图片处理的知识,可以拿来做一些小应 ...
- Linux的远程连接工具:SSH的安装
在Linux执行命令很不方便,另外我们需要将自己计算机中的文件上传到Linux中,因此使用远程连接工具还是比较方便的. SSH安装 SSH的使用 打开安装好的软件:SSH Secure File Tr ...
- Spring Boot 整合Mybatis非starter时,mapper一直无法注入解决
本来呢,直接使用mybatis-spring-boot-starter还是挺好的,但是我们系统比较复杂,有多个数据源,其中一个平台自己的数据源,另外一些是动态配置出来的,两者完全没有关系.所以直接使用 ...
- 'root'@'127.0.0.1'没有grant privileges
从另外一台服务器拷贝了个mysql实例过来,给root@'%'授权的时候提示ERROR 1045 (28000): Access denied for user 'root'@'localhost' ...
- 【题解】Luogu P4391 [BOI2009]Radio Transmission 无线传输
原题传送门 这题需要用到kmp匹配 推导发现: 设循环节的长度为x,那么kmp数组前x个都是0,后面kmp[x+n]=n 先求出kmp数组 答案实际就是len-kmp[len] #include &l ...
- 【题解】Luogu P4450 双亲数
原题传送门 这题需要运用莫比乌斯反演(懵逼钨丝繁衍) 设F(t)表示满足gcd(x,y)%t=0的数对个数,f(t)表示满足gcd(x,y)=t的数对个数,实际上答案就是f(d) 这就满足莫比乌斯反演 ...
- RMAN入门——简介
RMAN(Recovery Manager) 1.简介 RMAN(Recovery Manager)是随Oracle服务器软件一同安装的工具软件,它可以用来备份和恢复数据库文件.归档日志和控制文件 ...
- UVa Live 4670 Dominating Patterns - Aho-Corasick自动机
题目传送门 快速的通道I 快速的通道II 题目大意 给定一堆短串,和一个文本串,问哪些短串在文本串中出现的次数最多. 我觉得刘汝佳的做法,时间复杂度有问题.只是似乎这道题短串串长太短不好卡.比如给出的 ...
- Docker 入门指南——资源工具篇
好工具 dive wagoodman/dive A tool for exploring each layer in a docker image 参考 用 Dive 看 Docker Image 裡 ...