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 • Saturday, June 27, 2026. 11:45 pm UTC+00:00 • Commit: 4314778