Prerequisites
- A workspace with a connected git repository.
- A project open in the Code IDE.
- Either Git Lite or Git Advanced enabled.
Steps
1
Prune merged branches in one click
Pruning finds the local branches whose remote branch no longer exists, usually because their pull request merged and the branch was deleted. It lists them before it deletes anything.
- Git Lite
- Git Advanced
- In the Git Lite panel, click ⋯ (More Git actions) next to the refresh icon.
- Click Prune merged branches. Git Lite fetches from the remote and finds the branches to prune.
- Review the list in the These branches will be pruned dialog.
- Click Sure, continue! to delete them.
2
Delete a specific branch (Git Advanced)
For Git Advanced users who need to delete a specific branch individually, including one that has not been merged yet:
- Open the Git Advanced panel in the left sidebar.
- Click the three-dot menu (⋯) at the top left of the sidebar.
- Select Delete Branches from the dropdown.
- Choose the branch you want to delete from the list.
- Confirm the deletion.
You will know it worked when the pruned or deleted branches no longer appear in the branch list. If a branch remains after pruning, it still exists on the remote, or it was never pushed. Delete it on your Git provider, or delete your local copy with
git branch -D <branch_name> in the terminal.Next steps
Resolve merge conflicts
Handle conflicts when Git can’t merge two branches automatically.
Use Git Advanced
Take full control of staging and branch management.
Version control reference
Every Git feature in the Code IDE.