{"thread":{"id":"31701","subject":"Deletion of remote branches","startedAt":"2012-10-01T13:22:44Z","lastAt":"2012-10-02T06:57:21Z","messageCount":5,"participants":["Jens Hausherr","Junio C Hamano","Philip Oakley"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"200257","messageId":"CC8F65C7.E79%jens.hausherr@xing.com","threadId":"31701","inReplyTo":null,"subject":"Deletion of remote branches","fromName":"Jens Hausherr","fromEmail":"jens.hausherr@xing.com","sentAt":"2012-10-01T13:22:44Z","receivedAt":"2012-10-01T13:22:44Z","isPatch":false,"sender":{"key":"jens.hausherr@xing.com","avatar":null},"body":"Hi,\n\nI came across an issue with deleting remote branches: When deleting a\nbranch using \"git branch ­r ­d <branch>\" the branch is deleted and no\nlonger shown by \"git branch ­r\".\n\n\"git ls-remote --heads\" on the other hand still lists the ref for the last\nbranch commit.\n\nIf I delete the branch using \"git push origin :<branch>\" the branch is\nremoved completely (i.e. git ls-remote  no longer returns a ref).\n\nIs this a bug or is this behavior intentional? (I am currently using git\n1.7.12).\n\nCheers,\nJens\n\n-- \nJens Hausherr\nSenior Software Engineer QA\njens.hausherr@xing.com\n \nXING AG\nGaensemarkt 43, 20354 Hamburg, Germany\n\nTel. +49 40 419131-634, Fax +49 40 419131-11\n \n\nCommercial Reg. (Registergericht): Amtsgericht Hamburg, HRB 98807\nExec. Board (Vorstand): Dr. Stefan Groß-Selbeck (Vorsitzender), Dr. Thomas\nVollmoeller, Ingo Chu, Dr. Helmut Becker, Jens Pape\nChairman of the Supervisory Board (Aufsichtsratsvorsitzender): Dr. Neil\nSunderland\n \n\nPlease join my network on XING\n<https://www.xing.com/go/invite/3287358.18c191>\n\nThis e-mail may contain confidential and/or privileged information. If you\nare not the intended recipient (or have received this e-mail in error)\nplease notify the sender immediately and destroy this e-mail. Any\nunauthorised copying, disclosure or distribution of the material in this\ne-mail is strictly forbidden and may be unlawful.\n"},{"id":"200271","messageId":"7v1uhids5a.fsf@alter.siamese.dyndns.org","threadId":"31701","inReplyTo":"CC8F65C7.E79%jens.hausherr@xing.com","subject":"Re: Deletion of remote branches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-01T17:22:09Z","receivedAt":"2012-10-01T17:22:09Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jens Hausherr <Jens.Hausherr@xing.com> writes:\n\n> I came across an issue with deleting remote branches: When deleting a\n> branch using \"git branch ­r ­d <branch>\" the branch is deleted and no\n> longer shown by \"git branch ­r\".\n>\n> \"git ls-remote --heads\" on the other hand still lists the ref for the last\n> branch commit.\n>\n> If I delete the branch using \"git push origin :<branch>\" the branch is\n> removed completely (i.e. git ls-remote  no longer returns a ref).\n\nAll of the above are expected and working as designed.  Remote\ntracking branches are local _copies_ of what you have over there at\nthe remote repository. The latter is the authoritative version, and\nyou asked \"ls-remote\" to go over the network to view them.\n\nIf you are trying to remove the branches you show to others and\nyourself who are observing that remote repository from your local\nworkstation, you can first \"git push origin :<branch>\" to remove it\nin the remote repository. You can run your next fetch with \"--prune\"\nto get rid of remotes/origin/<branch>, I think.\n"},{"id":"200289","messageId":"583784AD1BE54FD582B1D58FE7F4CADA@PhilipOakley","threadId":"31701","inReplyTo":"7v1uhids5a.fsf@alter.siamese.dyndns.org","subject":"Re: Deletion of remote branches","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2012-10-01T20:12:10Z","receivedAt":"2012-10-01T20:12:10Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Junio C Hamano\" <gitster@pobox.com>\n> Jens Hausherr <Jens.Hausherr@xing.com> writes:\n>\n>> I came across an issue with deleting remote branches: When deleting a\n>> branch using \"git branch ­r ­d <branch>\" the branch is deleted and no\n>> longer shown by \"git branch ­r\".\n>>\n>> \"git ls-remote --heads\" on the other hand still lists the ref for the \n>> last\n>> branch commit.\n>>\n>> If I delete the branch using \"git push origin :<branch>\" the branch \n>> is\n>> removed completely (i.e. git ls-remote  no longer returns a ref).\n>\n> All of the above are expected and working as designed.  Remote\n> tracking branches are local _copies_ of what you have over there at\n> the remote repository. The latter is the authoritative version, and\n> you asked \"ls-remote\" to go over the network to view them.\n>\nIs there a definitive naming convention for the two types of 'remote \nbranch'?\n\nIIRC (somewhere) the 'tracking' term was to be deprecated, though it is \nstill in common use. It is usually only the context that clarifies if it \nis the local or the distant copy/repo.\n\nDistinct names make for less confusion.\n\n> If you are trying to remove the branches you show to others and\n> yourself who are observing that remote repository from your local\n> workstation, you can first \"git push origin :<branch>\" to remove it\n> in the remote repository. You can run your next fetch with \"--prune\"\n> to get rid of remotes/origin/<branch>, I think.\n>\n\nPhilip \n"},{"id":"200292","messageId":"7vhaqdc4ap.fsf@alter.siamese.dyndns.org","threadId":"31701","inReplyTo":"583784AD1BE54FD582B1D58FE7F4CADA@PhilipOakley","subject":"Re: Deletion of remote branches","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-01T20:42:38Z","receivedAt":"2012-10-01T20:42:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n>> All of the above are expected and working as designed.  Remote\n>> tracking branches are local _copies_ of what you have over there at\n>> the remote repository. The latter is the authoritative version, and\n>> you asked \"ls-remote\" to go over the network to view them.\n>>\n> Is there a definitive naming convention for the two types of 'remote \n> branch'?\n>\n> IIRC (somewhere) the 'tracking' term was to be deprecated, though it is \n> still in common use. It is usually only the context that clarifies if it \n> is the local or the distant copy/repo.\n\nThat is somewhat different from what I recall:\n\n - \"refs/remotes/$there/$that\" is a copy of $that branch at the\n   remote $there; we call that a \"remote tracking branch\".\n\n   When people say \"remote branch\", they often mean $that branch at\n   the remote $there, not your local copy of it.\n\n   When you say \"remote tracking branch\", you are talking about\n   something you locally have to track the corresponding \"remote\n   branch\".  This use is not deprecated at all.  That is the only\n   sane way to clarify which one of the two you are talking about.\n\n - If your branch \"foo\" always integrates with branch \"bar\" at the\n   remote \"xyzzy\", you would often run\n\n\tgit pull xyzzy bar\n        git pull --rebase xyzzy bar\n\n   after running \"git chekcout foo\".  You may even have this in your\n   per-repository configuration:\n\n\t[branch \"foo\"]\n\t\tremote = xyzzy\n                merge = refs/heads/bar\n\n   In such a situation, some people (used to) say that \"foo tracks\n   bar from xyzzy\".  While such a colloquial use is perfectly fine\n   when it is clear that \"foo\" being discussed is your local branch,\n   the verb \"track\" in that sentence is used to mean an entirely\n   different kind of relationship between your \"remotes/xyzzy/bar\"\n   and the branch \"bar\" at remote \"xyzzy\", where the former is the\n   \"remote tracking branch\" for the latter, leading to confusion.\n   This use of 'track' is what is discouraged these days.\n\nI think we call the latter @{upstream} of \"foo\" these days.\n"},{"id":"200308","messageId":"CC905CB7.E8B%jens.hausherr@xing.com","threadId":"31701","inReplyTo":"7vhaqdc4ap.fsf@alter.siamese.dyndns.org","subject":"Re: Deletion of remote branches","fromName":"Jens Hausherr","fromEmail":"jens.hausherr@xing.com","sentAt":"2012-10-02T06:57:21Z","receivedAt":"2012-10-02T06:57:21Z","isPatch":false,"sender":{"key":"jens.hausherr@xing.com","avatar":null},"body":"Ok, thanks for clarifying this.\n\n\n\"Philip Oakley\" <philipoakley@iee.org> writes:\n\n>All of the above are expected and working as designed.  Remote\n>tracking branches are local _copies_ of what you have over there at\n>the remote repository. The latter is the authoritative version, and\n>you asked \"ls-remote\" to go over the network to view them.\n"}]}