git-update-ref
Safely update Git reference values
TLDR
Update ref to new value
$ git update-ref [refs/heads/branch] [commit]
Delete ref$ git update-ref -d [refs/heads/branch]
Create symbolic ref$ git update-ref --symbolic-ref [ref] [target]
Update with old value check$ git update-ref [ref] [new] [old]
SYNOPSIS
git update-ref [options] ref newvalue [oldvalue]
DESCRIPTION
git update-ref safely updates ref names stored in the repository. It provides atomic ref updates with optional old value verification, ensuring that a ref is only changed if it currently points to an expected value.
This is a low-level plumbing command used internally by higher-level commands like `git branch` and `git tag`.
PARAMETERS
-d
Delete ref.--create-reflog
Create reflog.--no-deref
Don't dereference symbolic.-m reason
Reflog message.--stdin
Read from stdin.
SEE ALSO
git-symbolic-ref(1), git-branch(1)
