git push . :refs/for/foo 意思

来源:互联网 发布:js跳转代码 编辑:程序博客网 时间:2024/05/21 18:46

The "." argument means "push to this repository", and the refspec HEAD:refs/for/foo means "take the current commit that HEAD is pointing to, and make a new ref (similar to a branch, although those are usually stored as refs/heads/something) named refs/for/foo that points to the same commit".

Essentially, it's creating a new "branch" at the current commit, but since the desired name isn't in the normal branch name-space, we can't just use git branch refs/for/foo.

You should be able to undo it with git push . :refs/for/foo - naming an empty source to replace the ref with.