How can you list all branches in your repository?
Posted by MaryJns
Last Updated: June 09, 2024
To list all branches in your Git repository, you can use the following commands in your terminal or command prompt: 1. To list local branches:
git branch
2. To list remote branches:
git branch -r
3. To list both local and remote branches:
git branch -a
Each command will display the branches in your repository as follows: - Local branches will be shown without a prefix. - Remote branches will be prefixed with the name of the remote (e.g., origin/branch-name). - Both local and remote branches will be shown with the -a option. If you want more detailed information about the branches, you might also consider using:
git show-branch
These commands should work seamlessly as long as you are inside a Git repository.