Depending on your needs, you should consider using filter_var() with the FILTER_VALIDATE_BOOLEAN flag.filter_var( 'true', FILTER_VALIDATE_BOOLEAN); // true filter_var( 1, FILTER_VALIDATE_BOOLEAN);…
You just need to delete the branch you are on. You can’t use git branch -D
as this has a safety check against doing this. You can use update-ref
to do this.
git update-ref -d HEAD
Do not use rm -rf .git
or anything like this as this will completely wipe your entire repository including all other branches as well as the branch that you are trying to reset.