A local branch is a branch that exists only on your computer.
A tracking branch is a local reference to a remote branch but is not a local branch
There are two types of local branches:
git branch <branchNameToCreate> [<start-point>]
# example
git branch branchName1 branchName2
where:
Example:
git checkout -b branchName
git branch branchname <remote/branch>
git branch --track <branchname> [<start-point]
# example
git branch --track branch_name origin/branch_name
git branch
* branch_name
master
git branch -vv
* branch_tracked 95cf879 [origin/branch_name] * Commit message
master f3c6174 [origin/master] * Pull Request
branch_not_tracked c750e03ed * Commit message 2
git branch -d <branchname>
# Force
git branch -D <branchname>
Each local branch has a refs file under .git/refs/heads/
git branch (-m|--move) <oldbranch> <newbranch>
Example: rename master to main
git branch -m master main
git branch -l -vv