git branch
is a Git command used to list, create, or delete branches in a Git repository. When used with no arguments, it lists all existing branches in the repository.
Here’s an example of how git branch
can be used:
$ git branch
* master
development
feature-123
In this example, the git branch
command is used to list all the branches in the repository. The *
character indicates the currently checked out branch, which is master
in this case. The other branches listed are development
and feature-123
.
You can also use git branch
with additional arguments to create or delete branches. For example, to create a new branch called new-feature
, you can run:
$ git branch new-feature
And to delete a branch called old-feature
, you can run:
$ git branch -D old-feature
I hope this helps! Let me know if you have any other questions.