主人,是不是在10号房。然而,我最终意识到我在这个过程中破坏了一些测试没有发现的东西。
我最终提交了 # 5,然后慢慢地重新做了每次提交的开发,并不断地调整它,以确保它不会重新导致 bug。现在我基本上又回到了第10条,但是做了一些更改来防止 bug 的发生。
我现在想用我的改变创建提交 # 11。但是当我试图推到主我得到
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push master HEAD:<name-of-remote-branch>
这是意料之中的,但是我如何将它推送到我的远程分支呢?
我试过 git push origin HEAD:master
,但是得到了这个:
! [rejected] HEAD -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/tomhammond/sample.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
当我做 git status
的时候,我看到的是 HEAD detached from 4a74ac3