Is there a way to delete a branch from a Git repository without doing a clone or any other sort of local copy?
Basically I'm working on a dashboard for a release pipeline and don't want to have to have any of the working project's code on the dashboards server just to delete deployed feature branches.
In case it matters, we use Atlassian Stash and not Github.
I'm looking to do something similar to:
git branch -D ssh://[email protected]/team/project/feature/deleteme
Easy, from any git repo
git push u://r/l +:refs/heads/branchname
and if you don't happen to have one handy, just make a trash one anywhere with e.g. git init deleteme
.
Some repo administrators who've had to give push access to unreliable developers have shut off delete-by-push access, so some repos will reject that command, but it's enabled by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With