作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
<分区>
Possible Duplicates:
git: Switch branch and ignore any changes without committing.
Git branches behaving strangely
我知道一般建议是在 git 中切换分支之前保持干净状态。 ( stash 或 park-commit )。我试图了解我什么时候会得到“你有本地更改不能切换分支”,我无法遵循逻辑:
我有一个 repo,有一个名为 version.txt 的文件,包含文本“1”:
git checkout -b new
echo 2 >> version.txt (working dir is not dirty, modified the file)
git checkout master ( how come this works ? I have not stages\commited my changes on new )
如果我删除新分支中的文件内容,或者先暂存文件,也会发生同样的情况。
有人可以帮助我了解我什么时候会收到“您有本地更改无法切换分支。” ?
谢谢,冉
我是一名优秀的程序员,十分优秀!