0
我想了解爲什麼我無法通過創建具有有效引用的遠程分支,如head^
或SHA。在git中,爲什麼本地分支需要創建一個遠程分支?
git push origin SHA:test
git push origin head^:test
這些命令都失敗:
error: unable to push to unqualified destination: test
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'remote'
這迫使我創建並立即刪除本地分支,這似乎傻
git branch tmp head^
git push origin tmp:test
git branch -D tmp
是否有更簡單的方法來做到這個?
請注意,如果origin/test
已存在,前兩個命令是成功的。