2019-1-16-git-subtree-pull-错误-Working-tree-has-modifications
2023-09-27 14:28:50 时间
title | author | date | CreateTime | categories |
---|---|---|---|---|
git subtree pull 错误 Working tree has modifications |
lindexi |
2019-1-16 19:4:55 +0800 |
2018-2-13 17:23:3 +0800 |
git |
git subtree 是不错的东西,用于 git 管理子项目。 本文记录我遇到问题和翻译网上的答案。
当我开始 pull 的时候,使用下面的代码
git subtree pull --prefix=<本地子项目目录> <远程库仓库地址 | 远程库别名> <分支> --squash
其中--squash
参数是把子项目的记录合成一次 commit 提交到主项目,这样主项目只是合并一次 commit 记录。
但是在我执行这句代码的时候,出现下面的错误
Working tree has modifications. Cannot add.
当我检查本地是否有没提交的保存时候,没有找到
git status
这个问题是因为git diff-index HEAD
返回结果,即使本地没提交,解决这个问题很简单。切换到本地另一个分支然后切换回来,这样就可以解决
git checkout 其他分支
git checkout master
如果执行了上面的命令还无法使用,请告诉我。
相关文章
- 【C语言】动态内存常见错误及经典笔试题
- git出现“The file will have its original line endings in your working directory”错误
- 攻击DNS之利用顶级域名配置错误监控Windows域用户
- Java从入门到精通——调错篇之SVN 出现 Loced错误
- centos 6 apt.sw.be 错误 无法yum安装软件解决方案
- Spring 常犯的十大错误,打死都不要犯!
- **PHP错误Cannot use object of type stdClass as array in错误的
- redirect uri 参数错误 怎么办
- 使用Git的Push出现rejected - non-fast-forward错误
- 解决git bash闪退问题 报openssl错误
- git pull 解决 refusing to merge unrelated histories 错误
- git 上传错误This oplation equires one of the flowi vrsionsot the NET Framework:.NETFramework
- ubuntu进行apt-get时候出现Package ssh is not available, but is referred to by another package 错误
- git subtree pull 错误 Working tree has modifications
- git如何回滚错误合并的分支
- 【我的Android进阶之旅】Android目录过长造成错误:Failed to crunch file abc_textfield_search_activated_mtrl_alpha.9.png