diff --git a/guides/branches.mdx b/guides/branches.mdx index 3bb82ef9a..706d6565c 100644 --- a/guides/branches.mdx +++ b/guides/branches.mdx @@ -123,3 +123,31 @@ Use clear, descriptive names that explain the purpose of a branch. ## Merge branches Once your changes are ready to publish, create a pull request to merge your branch into the deployment branch. + +## Delete a branch + +After merging a branch, you can delete it to keep your repository organized. + + + + After your pull request is merged, the web editor displays a notification that the branch has been merged. Click **Delete branch** to remove the branch from your repository. + + + You cannot delete the deploy branch or the repository's default branch (usually `main`). + + + + + Delete a branch locally and remotely: + + ```bash + # Delete the local branch + git branch -d branch-name + + # Delete the remote branch + git push origin --delete branch-name + ``` + + Use `-D` instead of `-d` to force delete a branch that hasn't been merged. + +