Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Git Branch

Always name branches as lowercase, as case-sensitive branches do not work across all operating systems.

Create a New Branch

git branch --copy new-branch

Create a Branch From a Specific Branch

git branch --copy new-branch old-branch

Delete a Branch

Only works if it’s fully merged.

git branch --delete dev

Delete a Remote Branch

Only works if it’s fully merged.

git branch --delete --remotes dev

Move a Branch

git branch --move old-branch new-branch

See all Branches

git branch --all

References

github - Git branch name - case sensitive or insensitive? - Stack Overflow

Git - git-branch Documentation

Last Modified • Sunday, June 14, 2026. 5:09 am UTC+00:00 • Commit: 4a9f867