一个奇怪的 git 问题

2017-08-08 18:07:27 +08:00
 kaminic
➜ android git:(feature-new-ui) ✗ git status -s
➜ android git:(feature-new-ui) git checkout develop
Switched to branch 'develop'
Your branch is ahead of 'origin/develop' by 1 commit.
(use "git push" to publish your local commits)
➜ android git:(develop) git status -s
➜ android git:(develop) git checkout feature-new-ui
Switched to branch 'feature-new-ui'
Your branch is ahead of 'origin/feature-new-ui' by 2 commits.
(use "git push" to publish your local commits)
➜ android git:(feature-new-ui) ✗ git status -s
D ByteParser/build.gradle
D ByteParser/src/main/java/com/nd/byteparser/ByteParser.java

当前分支是 feature-new-ui 是干净的,
从 feature-new-ui 切到 develop, develop 也是干净的,
再从 develop 切到 feature-new-ui
这时,多了两条文件发生变化的记录,
这是什么原因???
2660 次点击
所在节点    git
5 条回复
jesse_luo
2017-08-08 23:29:32 +08:00
大小写?
majinjing3
2017-08-09 00:40:54 +08:00
.gitignore 引起的吧,
kaminic
2017-08-09 09:49:48 +08:00
@majinjing3 不是.gitignore
TimRChen
2017-08-09 10:38:35 +08:00
切到 feature-new-ui 分支时,有两个 commit,你应该 git stash 暂存,然后再切回
kaminic
2017-08-09 15:16:30 +08:00
@TimRChen 暂存是对于不干净的工作区来说的,我的工作区已经是干净的了,两个 commit 是说我本地有两个 commit 没有 push

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/381440

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX