As far as I understand these two commands can remove remote-tracking branches. Is there any difference between them?
git remote prune <branch_name>git branch -d -r <branch_name>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. But you can prove it to yourself: copy your git repo and run each command in each copy. Then do a diff on the two .git folders within those repos.
Your prune command needs the remote name, not the branch name. This will delete all remote tracking branches that are not on the remote specified. Your branch -d -r parameter should be
<remote>/<branch_name>.