To remove a Git branch both locally and remotely, follow these steps:
First, switch to the branch you want to delete. You can use the following command to switch the branch:
git checkout <branch-name>
Once you are on the branch you want to delete, you can delete the branch locally using the following command:
git branch -D <branch-name>
To delete the same branch from the remote repository, use the following command:
git push origin --delete <branch-name>
This will delete the branch from the remote repository.
That's it. You have removed the Git branch both locally and remotely.
Asked: 2023-06-12 11:44:32 +0000
Seen: 17 times
Last updated: Jun 12 '23