对于我们 repo 中的某些提交(但不是全部),如果我检查提交,然后返回到 master 分支,我会收到关于提交被遗忘的意外警告:
# Check out one of the commits in question:
$ git checkout dd33caa5b004b0e3bd449152f9335e40450db91c
Note: checking out 'dd33caa5b004b0e3bd449152f9335e40450db91c'.
You are in 'detached HEAD' state. You can look around, make experimental
[...]
HEAD is now at dd33caa... Organized DataStore build files, added cleanup targets.
# Now switch back to the master branch so I can work:
$ git checkout master
Warning: you are leaving 17 commits behind, not connected to
any of your branches:
dd33caa Organized DataStore build files, added cleanup targets.
4916eec Fixes to C++ codegen to use maven features.
a26291d Merge branch 'master' of [redacted origin repo address]
93ae0b9 Add protobuf 2.4.1 jar file to install scripts. Add QTDIR to build script.
... and 13 more.
If you want to keep them by creating a new branch, this may be a good time
to do so with:
git branch new_branch_name dd33caa5b004b0e3bd449152f9335e40450db91c
Switched to branch 'master'
所有有问题的提交(据我所知)都可以从 master 访问,并且在分离的 head 状态下我没有进行任何提交(这是我们存储库的干净克隆)。master 分支的历史是这样的:
* 04d7fcc (HEAD, origin/master, origin/HEAD, master) Removed files from DataS
* ecaa2f5 Fixed .gitignore.
* dd33caa Organized DataStore build files, added cleanup targets.
* 4916eec Fixes to C++ codegen to use maven features.
* a26291d Merge branch 'master' of [redacted]
|\
| * 93ae0b9 Add protobuf 2.4.1 jar file to install scripts. Add QTDIR to buil
| * 3cba845 switched to protobug 2.4.1 jar files
| * 1046d22 fixed GATEWAY_ROOT
| * ebcda06 edit windows build scripting path for new repo location
| * bda1e17 add windows build scripts from old repo
* | 371883d Merge branch 'master' of [redacted]
|\ \
| |/
| * 771c579 Fix MCast and RMCast service names in gateway manager config
* | 864fb25 First cut at DataStore code generation update to sync with refact
|/
* f505e46 Testing new repository
* 111d89a Merge branch 'master' of [redacted]
知道这里可能会发生什么吗?它似乎与一个特定用户的提交有关,我可以在 OSX 上使用 Git 1.7.9.6 和在 Ubuntu 上使用 Git 1.7.9.5 来重现这一点,但在 Ubuntu 上却不能使用 1.8.0 ......所以可能是 Git 错误?不过,我在发行说明中看不到任何相关的内容...