To completely remove a branch from your git server (including history), simply use the following command:git push origin --delete [branch name]Then you need to run the following command on the instances to remove the information of the deleted branch: git ...
TBWritten byThomas Bourdin1 min read
To completely remove a branch from your git server (including history), simply use the following command:
git push origin --delete [branch name]
Then you need to run the following command on the instances to remove the information of the deleted branch: git fetch --all --prune
If for one reason or another, you need to delete one or more files from previous commits, here is an interesting article on the subject:
This tutorial retains the command and the context of its publication. Before using it on a current repository, inspect the branch, the modified files, and the exact target:
git status --short
git log --oneline --decorate -5
Create a backup branch or tag when the operation rewrites history or deletes files. In particular, git reset --hard overwrites the changes in the working directory.