How to safely delete local and remote branches after they have been merged.
Once a feature branch has been successfully merged into your main branch, it is good practice to delete it to keep your repository clean and tidy. Deleting old branches prevents clutter and makes it easier to see what work is currently in progress. To delete a local branch, you use the `git branch -d <branch-name>` command. The `-d` (lowercase) flag is a safety measure; it will only allow you to delete a branch if its changes have already been merged into another branch. If you want to force-delete a branch that has unmerged changes (which you should do with extreme caution), you can use the `-D` (uppercase) flag. Deleting a local branch does not affect any remote branch with the same name. To delete a branch from a remote repository like GitHub, you use the command `git push origin --delete <branch-name>`. This helps keep the central repository as clean as your local one.