1

我正在对分支 atomic_boron 上的代码进行一些补充。遇到错误后,我运行了命令:

git checkout HEAD^^

为了回到(大概)工作状态以确保它确实有效。但是,现在每当我运行时:

git checkout atomic_boron

它把我带到了旧的提交。但是, git log 显示较新的提交仍然存在。如果我签出最近的提交,它会让我进入一种我似乎无法摆脱的超然状态。在分离的头部状态下,我尝试运行:

git checkout -b wtf_detached_head
git checkout atomic_boron
git merge wtf_detached_head

但合并声称分支之间没有差异。

tl; dr:我想做的就是将 head 重新附加到 atomic_boron 上的最新提交,但 git 坚持以分离的 head 状态签出提交。

如果有帮助,这是 reflog 的输出:

b66c7bd HEAD@{0}: checkout: moving from b66c7bd68f926cf9bb8b0b531252e91599d086ca to atomic_boron
b66c7bd HEAD@{1}: checkout: moving from atomic_boron to b66c7bd68f926cf9bb8b0b531252e91599d086ca
b66c7bd HEAD@{2}: checkout: moving from wtf_detached_head to atomic_boron
b66c7bd HEAD@{3}: checkout: moving from atomic_boron to wtf_detached_head
b66c7bd HEAD@{4}: checkout: moving from wtf_detached_head to atomic_boron
b66c7bd HEAD@{5}: checkout: moving from b66c7bd68f926cf9bb8b0b531252e91599d086ca to wtf_detached_head
b66c7bd HEAD@{6}: checkout: moving from atomic_boron to b66c7bd68f926cf9bb8b0b531252e91599d086ca
b66c7bd HEAD@{7}: checkout: moving from b66c7bd68f926cf9bb8b0b531252e91599d086ca to atomic_boron
b66c7bd HEAD@{8}: checkout: moving from atomic_boron to b66c7bd68f926cf9bb8b0b531252e91599d086ca
b66c7bd HEAD@{9}: checkout: moving from master to atomic_boron
f99923a HEAD@{10}: checkout: moving from b66c7bd68f926cf9bb8b0b531252e91599d086ca to master
b66c7bd HEAD@{11}: checkout: moving from atomic_boron to b66c7bd68f926cf9bb8b0b531252e91599d086ca
b66c7bd HEAD@{12}: checkout: moving from b66c7bd68f926cf9bb8b0b531252e91599d086ca to atomic_boron
b66c7bd HEAD@{13}: checkout: moving from atomic_boron to b66c7bd68f926cf9bb8b0b531252e91599d086ca
b66c7bd HEAD@{14}: checkout: moving from atomic_boron to atomic_boron
b66c7bd HEAD@{15}: checkout: moving from master to atomic_boron
f99923a HEAD@{16}: checkout: moving from atomic_boron to master
b66c7bd HEAD@{17}: checkout: moving from 4808ed19b72af9d9b2f2dd075438284506f6cd2f to atomic_boron
4808ed1 HEAD@{18}: checkout: moving from atomic_boron to HEAD^^
b66c7bd HEAD@{19}: commit (amend): Ground and excited state boron densities are now being calculated and output.

编辑:这是输出

git log --graph --oneline --decorate

* b66c7bd (HEAD, atomic_boron) Ground and excited state boron densities are now being calculated and output. The code compiles without errors.  I will begi
*   a6b561c Merge branch 'atomic_boron' of ssh://aero-mdgpu2.engin.umich.edu/home/brandon/.software/HPHall into atomic_boron
|\
| * 0c73784 Added variable MIN_YIELD during boron creation.  When the calculated sputter yield is less then MIN_YIELD, a Monte Carlo test is performed to d
* | 4808ed1 Saving my work on adding boron excitation and ionization.  I just realized that my MIN_YIELD changes that are vital to the stability of the cod
* | 14d2394 Added table lookups for ionization and excitation of boron to boron.c. I still have to write the functions that will call the lookup tables, as
* | 5e7a4af Changed struct type for boron atoms from neutral_type to boron_type, which includes a tag for the electronic state of the atoms. This will allo
|/
* 6fd8010 Forgot to initialize "boron_per_cell".  Added a line to allocate the memory for that variable.
* a83a6ce Added some lines to zero the boron fluxes during initialization.
* e205831 Oops.
* 0294ab6 Hack fix...  Moved check for being past cell boundaries to before the xi-eta integration.  This should at least give me some results for an IEPC
* e395310 Trying to debug by tracking where B atoms are created...
* f99923a (master) Fixed first set of bugs.  Am now dealing with seg faults due to boron atoms passing the right-hand side of the domain.  This may be rela
* 5b7c89b Have compiling code with boron.  Proceeding to testing and debugging.
* e8c1572 Yet another commit to save my work...
* eade77e Major additions to boron.c.  boron_create() is nearly finished; Only need to finish coding velocity components and addition of particles to boron
* 13a98fc Second commit on atomic_boron...  Just saving my work, nothing to see here.
* 49b2ef1 Initial commit on branch atomic_boron.

所以,看起来我只是愚蠢的。这里没什么有趣的!谢谢你的帮助,诚!

4

0 回答 0