DELAPARRA
Index
Color
NL
Category: Git commands

git branch

Explained by Updated

What is git branch?

git branch: List, create, or delete branches. git branch lists, creates and deletes branches. git branch shows local branches, git branch feature/export creates one, and git branch -d feature/export deletes it after it has been merged. A branch is a lightweight pointer to a commit, so creating one is instant. That makes it normal to start a new branch for every feature or fix, keeping work in progress separate from the main code.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about git branch

What should you keep in mind with git branch?

Keep branches short-lived. A branch that lives for weeks drifts away from main, and merging it back becomes painful. Delete branches after merging, both locally and on the remote, so the list stays readable. git branch -vv shows which remote branch each local branch tracks and whether you are ahead or behind it.

At a glance

CategoryGit commands
Explained by
Updated

More Git commands terms

All terms starting with G

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.