git push . :refs/for/foo 意思

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.

你可能感兴趣的:(git push . :refs/for/foo 意思)