Can';不要将我的提交推到github

Can';不要将我的提交推到github,github,Github,无法将我的提交推送到github 具有超级怪异的node.js行为,发现解决方案是恢复提交,然后使用Github的zip下载手动覆盖我的项目 这解决了我奇怪的node.js行为,但现在我无法让GitHub接受当前提交,因为它不是头 我的尝试: $ git push origin test-branch error: src refspec test-branch does not match any. error: failed to push some refs to 'https://git

无法将我的提交推送到github

具有超级怪异的node.js行为,发现解决方案是恢复提交,然后使用Github的zip下载手动覆盖我的项目

这解决了我奇怪的node.js行为,但现在我无法让GitHub接受当前提交,因为它不是头

我的尝试:

$ git push origin test-branch
error: src refspec test-branch does not match any.
error: failed to push some refs to 'https://github.com/name/project.git'

$ git push --force origin master:master
Everything up-to-date

$ git push origin HEAD:refs/heads/master
To https://github.com/name/project.git
! [rejected]        HEAD -> master (non-fast-forward)

有什么方法可以保存我吗?

您的测试分支不在remote上,您需要使用-u选项:

git push -u origin test-branch

ref

您的测试分支不在远程,您需要使用-u选项:

git push -u origin test-branch

ref

关于:git push-origin-HEAD:refs/heads/test-branch如何回答为什么要推给master?推动您的分支(测试分支),然后使用Pull请求合并两个分支。我建议现在如何合并分支?您使用Github吗?转到项目并使用“新建请求”按钮。base:master,compare:test branch关于:git push origin HEAD:refs/heads/test branch对问题的回答是:为什么要推给master?推动您的分支(测试分支),然后使用Pull请求合并两个分支。我建议现在如何合并分支?您使用Github吗?转到项目并使用“新建请求”按钮。基本:主,比较:测试分支