Forrest logo
back to the git tool

git-show-branch:tldr:373b8

git-show-branch: Compare both local and remote tracking branches.
$ git show-branch --all
try on your machine

The git show-branch --all command is used to display the branching structure and history of a Git repository.

Here is a breakdown of the command:

  • git show-branch is the main command used to display the branch history.
  • --all is an option that tells Git to show all branches, including remote branches.

When you run this command, Git will provide a graphical representation of the branching structure, showing the commit history of all branches. Each branch is represented by a line, and the commit points are denoted by asterisks. The command also shows which commit points are shared between different branches.

For example, the output can look like this:

! [develop] This is a commit message on the develop branch
 * [feature1] Add new feature1
  ! [feature2] This is a commit message on the feature2 branch
   * [master] Initial commit

In the above example, there are three branches: develop, feature1, and feature2. The commits made on each branch are displayed, with the most recent commit at the top. Commits shared between branches are denoted by an exclamation mark.

By using the --all option, you can get a comprehensive view of the entire branch history, including local and remote branches. This can be useful for understanding the relationship between different branches and tracking the progression of commits.

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