| Ko

Deleting merged Git branches

Once a PR is merged, the local branch behind it is dead weight. After a few months git branch scrolls past a screenful and you can’t find the branch you’re working on. The commands to clean this up are simple. The point is knowing what’s safe to delete. -d is safe, -D is dangerous There are two ways to delete a local branch. git branch -d deletes only branches that are already merged. If unmerged commits remain, it refuses. ...

July 11, 2024 · 4 min · 657 words · In-Jun
[email protected]