From fbf8bd293adc6e4a071a91fddbf6382d91b0b76f Mon Sep 17 00:00:00 2001 From: Ric Harvey Date: Fri, 3 May 2024 16:59:28 +0100 Subject: [PATCH] add info for deleting branches --- branches.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/branches.md b/branches.md index b7a2cbd..80b6258 100644 --- a/branches.md +++ b/branches.md @@ -83,6 +83,25 @@ Your branch is up to date with 'origin/main'. ls ``` +## Deleting a local and remote branch + +To delete a local branch you simple run: + +```bash +# Make sure you are in the main branch +git checkout main +# Delete a local branch +git branch -D demo-branch +``` + +You'll get a confirmation that the local branch has been deleted. But now is a good time to clean up the remote branch, you can do this by running the following command: + +```bash +git push origin --delete demo-branch +``` + +Now if you check back in the web gui you'll see only the main branch exists. + --- ##### Follow me for more guides