LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-symbolic-ref

Read and modify symbolic references like HEAD

TLDR

Show HEAD target
$ git symbolic-ref HEAD
copy
Set HEAD to branch
$ git symbolic-ref HEAD refs/heads/main
copy
Get short name
$ git symbolic-ref --short HEAD
copy
Delete symbolic ref
$ git symbolic-ref -d HEAD
copy

SYNOPSIS

git symbolic-ref [options] name [ref]

DESCRIPTION

git symbolic-ref reads and modifies symbolic references. HEAD is the most common symbolic ref, pointing to the currently checked-out branch. This plumbing command shows which branch HEAD points to or changes it programmatically.When HEAD is detached (pointing directly to a commit rather than a branch), this command will report an error, distinguishing it from `git rev-parse`.

PARAMETERS

NAME

Symbolic ref name (usually HEAD).
REF
Target ref to set.
--short
Show short name.
-d, --delete
Delete symbolic ref.
-q, --quiet
Quiet mode.
--help
Display help information.

INSTALL

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

CAVEATS

Plumbing command. HEAD is most common use. Detached HEAD is not a symbolic ref.

HISTORY

git symbolic-ref is a core Git plumbing command for managing symbolic references, fundamental to branch tracking.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid