Search code examples
gitgit-branchgit-branch-sculpting

How do I show branches only inside one branch folder or subfolder?


I have organized my branches into folders and subfolders. I am only accessing my GIT repo through the CLI. I would like to be able to list only branches inside a branch folder.

FEATURE/branch-1
FEATURE/branch-2
FEATURE/CURRENT/branch-000
FEATURE/CURRENT/branch-001
FEATURE/CURRENT/branch-002
* master
dev
v2.0.0/branch-3
v2.1.0/branch-4
v2.1.0/branch-5

> git branch shows me everything, however I would like to only see the v2.1.0 folder. Is there a command that can output only the v2.1.0 branch folder from my example above?

Also, as a bonus, is there a way to get a branch subfolder FEATURE/CURRENT/**?


Solution

  • git branch --list *v2.1.0* will show all branches with v2.1.0 in their branch name