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
如果执行了上面的命令还无法使用,请告诉我。
相关文章
- 详解Git合并(Merge)错误如何回退。(包括Reset, Revert和页面回滚三种,并说明其优缺点)
- Git 在 Windows 克隆的时候提示错误 Filename too long
- HTTP 错误 403.14 - Forbidden Web 服务器被配置为不列出此目录的内容
- 调用微信退款接口或发红包接口时出现System.Security.Cryptography.CryptographicException: 出现了内部错误 解决办法
- PHP错误与异常处理
- MyBatis 最常见错误,启动时控制台无限输出日志
- IDEA常见错误解决
- iOS 使用AFNetworking遇到错误 Request failed: unacceptable content-type: text/html
- 使用Git的Push出现rejected - non-fast-forward错误
- 解决git bash闪退问题 报openssl错误
- git 上传错误This oplation equires one of the flowi vrsionsot the NET Framework:.NETFramework
- Git 修正错误
- 报“ Got minus one from a read call”的错误
- MaxCompute - ODPS重装上阵 第一弹 - 善用MaxCompute编译器的错误和警告
- 在visual studio 2022 C++中配置最新版OpenCV和可能错误解决方案
- SonicWall“强烈敦促”客户修补关键的 SMA 100 错误
- 修正MYSQL错误数据的一个存储过程
- 使用fsck修复文件系统错误
- git报用户名和密码错误,删除本地存储的密码
- hadoop过程中遇到的错误与解决方法
- 2018-8-10-git-push-错误-hook-declined-
- git push 时发生 error: failed to push some refs to 错误 (解决办法)