git 假设不变和 git stash

标签 git gitignore git-stash git-assume-unchanged

我将一些本地配置保存在假定未更改的文件中。随着时间的推移,我创建了几个分支,并且假定未更改的文件在两者之间演变(添加更多本地配置)。如果我尝试结帐较旧的分支,则会得到:

error: Your local changes to the following files would be overwritten by checkout:
    <some assume-unchanged files>
Please, commit your changes or stash them before you can switch branches.

我不想提交它们并且不能 stash 它们(即使使用 --include-untracked 选项):
$ git stash
No local changes to save

有没有解决方案,或者有更好的工作流程让本地更改保持未提交?

最佳答案

目前,您需要使用适当的 .gitignore 文件或排除机制。假设不变意味着不同的东西。

关于git 假设不变和 git stash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27012598/

相关文章:

Git:无法创建符号链接(symbolic link)(文件名太长)

node.js - 如何将 .npmignore 目录中的单个文件列入白名单?

git - 我是如何搞砸这个非常简单的 .gitignore 文件的?

git - git stash 是特定于分支还是针对整个存储库?

git - 撤消 git 自动 merge

git - 如何将文件添加到 git 中的现有存储?

git - 在 Git 分支之间复制代码

Git 推送失败。错误 : RPC failed; result=56, HTTP 代码 = 0

git - "git push --mirror"删除远程标签。有什么方法可以恢复它们吗?

gitignore:忽略文件夹层次结构中的所有文件,除了一种特定的文件类型