Process Flow - Listing branches
Start in Git repo
Run 'git branch'
Git reads local branches
Display list of branches
End
The flow shows how Git lists all local branches when you run the 'git branch' command.
git branch| Step | Action | Evaluation | Result |
|---|---|---|---|
| 1 | Run 'git branch' command | Git checks local branch references | Finds branches: main, feature1, bugfix |
| 2 | Prepare output list | Mark current branch with '*' | * main feature1 bugfix |
| 3 | Display branches to user | Output list shown in terminal | Branches listed with current branch marked |
| 4 | End | No more actions | Command completes |
| Variable | Start | After Step 1 | After Step 2 | After Step 3 | Final |
|---|---|---|---|---|---|
| branches | empty | [main, feature1, bugfix] | [* main, feature1, bugfix] | [* main, feature1, bugfix] | [* main, feature1, bugfix] |
| current_branch | unknown | main | main | main | main |
git branch Lists all local branches in the current repository. The current branch is marked with '*'. To list remote branches, use 'git branch -r'. To list all branches (local + remote), use 'git branch -a'.