Originally, I wanted to delete a remote branch.
git push --delete <branchname>
... did it for me. However, I don't get the difference between the other commands:
git push --prune ...
git prune ...
What are these for? The manual does not help me since it sounds similar and I would have expected them to do what I initially wanted to.
git prune
acts on your local repository, and it removes objects (e.g. commits and files that are no longer reachable from any branch or tag, or from HEAD
). git push --prune
acts on the remote repository, and it removes branches that do not exist locally (be really careful with this command, as it will delete all branches that you've never checked out locally; if a branch is known to your local repo only as a remote branch, it'll be deleted remotely).
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