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 ...
随机推荐
- Git在Eclipse中的使用
一.把远程仓库的项目clone到eclipse里面: 最新版的Eclipse上已经集成了Git插件.所以在Eclipse中可以很方便的使用Git的功能. 在使用Git功能之前,需要先进行下简单的设置. ...
- Redhat 简单本地yum 配置
Redhat 简单本地yum 配置 一.将redhat 系统的镜像挂载到系统上 Vmware Workstion 环境下: [虚拟机设置]--[硬件]--[CD/DVD]--[使用ISO映像文件]-- ...
- .NET创建一个即是可执行程序又是Windows服务的程序
不得不说,.NET中安装服务很麻烦,即要创建Service,又要创建ServiceInstall,最后还要弄一堆命令来安装和卸载. 今天给大家提供一种方式,直接使用我们的程序来安装/卸载服务,并且可以 ...
- Oracle初级第一天
oracle卸载 运行regedit,删除HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ ...
- thinkphp 检测验证码
/** * 检测验证码 * @param integer $id 验证码ID * @return boolean 检测结果 */function check_verify($code, $id = 1 ...
- jQuery中prop和attr区别
问题 今天给一个button加onclick事件,由于最后button根据需要转成字符串,因此不能使用jQurey.click(),只能给button添加onclick属性的方式. 于是,$butto ...
- 【题解】 Luogu P4312 / SP4155 [COCI 2009] OTOCI / 极地旅行社
原题地址:P4312 [COCI 2009] OTOCI / 极地旅行社/SP4155 OTOCI - OTOCI lct入门难度的题,十分弱智(小蒟蒻说lct是什么,能吃吗?) bridge操作判联 ...
- Java 之 FileReader FileInputStream InputStreamReader BufferedReader 作用与区别
ava.io下面有两个抽象类:InputStream和ReaderInputStream是表示字节输入流的所有类的超类Reader是用于读取字符流的抽象类InputStream提供的是字节流的读取,而 ...
- bash 特性
命令hash: 缓存此前命令的查找结果:key-value key:搜索键 value:值
- [error] 2230#2230: *84 client intended to send too large body: 1711341 bytes
centos7 lnmp部署知乎上传主体报错 2019/01/17 18:55:27 [error] 2230#2230: *89 open() "/code/wordpress/favic ...