add info for deleting branches

This commit is contained in:
Ric Harvey 2024-05-03 16:59:28 +01:00
parent 65fd405063
commit fbf8bd293a
Signed by: ric
GPG key ID: CD63CE502B962F16

View file

@ -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