Forrest logo
back to the git tool

git-branch:tldr:41ba3

git-branch: Show the name of the current branch.
$ git branch --show-current
try on your machine

The command "git branch --show-current" is used in Git to display the name of the currently checked-out branch.

When you run this command, Git will look at your repository and show you the name of the branch you are currently on. This is useful, especially when you have multiple branches in your repository, and you want to quickly check which branch you are currently working on.

The output of this command will be the name of the current branch, which will be displayed on the terminal/console. If you are not on any branch (e.g., in a detached HEAD state), it will display "(HEAD)" instead.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the git tool