gitgit-plumbing

What is the git CLI equivalent of `echo 'ref: refs/heads/master' > .git/HEAD`


In other words, is there a safe way to just move HEAD without doing anything else?


Solution

  • git symbolic-ref HEAD refs/heads/master
    

    See https://git-scm.com/docs/git-symbolic-ref