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