对于我们的回购库中的某些提交(但不是全部),如果我签出提交,然后返回到主分支,我会收到意外的警告犯下被抛在后面:Git“commit left behind”when turn back to a branch from detached head
# 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'
所有问题提交(据我可以告诉)是从主可达,而在分离的头的状态(这是一个干净的克隆我还没有做出任何承诺我们的仓库)。主分公司的历史记录如下所示:
* 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错误?我没有在版本说明中看到任何看起来相关的东西,尽管...
'dd33caa'实际上是'ecaa2f5'的父提交吗?我知道它看起来像这样,但是当你做'git log --graph --pretty = oneline --all'时,孤立分支('git checkout --orphan newbranch')就会出现这种情况... – twalberg
是的,但是(由于此评论表的局限性,不能向您显示)。 – JonathonW
嗯....不知道其他“正常”的情况下会导致这种情况,所以往往表明一个错误... – twalberg