我正在尝试别名推送命令,所以我不必一直输入我的分支名称,而且我在这一步停滞不前:
Git push new local branch to remote, without having to specify name
此命令对我不起作用。我明白了:
$ git push origin -u head
error: src refspec head does not match any.
error: failed to push some refs to 'git@github.com:hurtstotouchfire/repo.git'
这个分支是通过克隆到repo中创建的,然后使用git checkout -b
创建新分支,进行提交,然后使用上面的push命令。是否需要使用此命令进行配置?
答案 0 :(得分:1)
git push origin -u HEAD
HEAD
是有效的参考号,head
不是。