From 7aaf48c3d67354487fc3650f59e56bcdac67916a Mon Sep 17 00:00:00 2001 From: Isabelle Viktoria Maciohsek Date: Sun, 4 Apr 2021 21:50:29 +0300 Subject: [PATCH] Add delete branch --- snippets/delete-branch.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 snippets/delete-branch.md diff --git a/snippets/delete-branch.md b/snippets/delete-branch.md new file mode 100644 index 000000000..ea7b85aa1 --- /dev/null +++ b/snippets/delete-branch.md @@ -0,0 +1,17 @@ +--- +title: Delete a branch +tags: repository,branch,beginner +--- + +Deletes a local branch. + +- Use `git branch -d ` to delete the branch with the specified branch name. + +```sh +git branch -d +``` + +```sh +git checkout master +git branch -d patch-1 # Deletes the `patch-1` local branch +```