Git branch command examples

Show the current branch:
git branch

Show all remote branches:
git branch -r

create new local branch linked to a remote existing one:
git checkout -b <new-local-branch> origin/<remote existing branch>
Example:
git checkout -b feature/myNewLocalBranch   origin/feature/myNewRemoteBranch

Lascia un commento 0

Your email address will not be published. Required fields are marked *