git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* Deletion of remote branches
@ 2012-10-01 13:22 Jens Hausherr
  2012-10-01 17:22 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Hausherr @ 2012-10-01 13:22 UTC (permalink / raw)
  To: git

Hi,

I came across an issue with deleting remote branches: When deleting a
branch using "git branch ­r ­d <branch>" the branch is deleted and no
longer shown by "git branch ­r".

"git ls-remote --heads" on the other hand still lists the ref for the last
branch commit.

If I delete the branch using "git push origin :<branch>" the branch is
removed completely (i.e. git ls-remote  no longer returns a ref).

Is this a bug or is this behavior intentional? (I am currently using git
1.7.12).

Cheers,
Jens

-- 
Jens Hausherr
Senior Software Engineer QA
jens.hausherr@xing.com
 
XING AG
Gaensemarkt 43, 20354 Hamburg, Germany

Tel. +49 40 419131-634, Fax +49 40 419131-11
 

Commercial Reg. (Registergericht): Amtsgericht Hamburg, HRB 98807
Exec. Board (Vorstand): Dr. Stefan Groß-Selbeck (Vorsitzender), Dr. Thomas
Vollmoeller, Ingo Chu, Dr. Helmut Becker, Jens Pape
Chairman of the Supervisory Board (Aufsichtsratsvorsitzender): Dr. Neil
Sunderland
 

Please join my network on XING
<https://www.xing.com/go/invite/3287358.18c191>

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden and may be unlawful.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Deletion of remote branches
  2012-10-01 13:22 Deletion of remote branches Jens Hausherr
@ 2012-10-01 17:22 ` Junio C Hamano
  2012-10-01 20:12   ` Philip Oakley
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2012-10-01 17:22 UTC (permalink / raw)
  To: Jens Hausherr; +Cc: git

Jens Hausherr <Jens.Hausherr@xing.com> writes:

> I came across an issue with deleting remote branches: When deleting a
> branch using "git branch ­r ­d <branch>" the branch is deleted and no
> longer shown by "git branch ­r".
>
> "git ls-remote --heads" on the other hand still lists the ref for the last
> branch commit.
>
> If I delete the branch using "git push origin :<branch>" the branch is
> removed completely (i.e. git ls-remote  no longer returns a ref).

All of the above are expected and working as designed.  Remote
tracking branches are local _copies_ of what you have over there at
the remote repository. The latter is the authoritative version, and
you asked "ls-remote" to go over the network to view them.

If you are trying to remove the branches you show to others and
yourself who are observing that remote repository from your local
workstation, you can first "git push origin :<branch>" to remove it
in the remote repository. You can run your next fetch with "--prune"
to get rid of remotes/origin/<branch>, I think.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Deletion of remote branches
  2012-10-01 17:22 ` Junio C Hamano
@ 2012-10-01 20:12   ` Philip Oakley
  2012-10-01 20:42     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Philip Oakley @ 2012-10-01 20:12 UTC (permalink / raw)
  To: Junio C Hamano, Jens Hausherr; +Cc: git

From: "Junio C Hamano" <gitster@pobox.com>
> Jens Hausherr <Jens.Hausherr@xing.com> writes:
>
>> I came across an issue with deleting remote branches: When deleting a
>> branch using "git branch ­r ­d <branch>" the branch is deleted and no
>> longer shown by "git branch ­r".
>>
>> "git ls-remote --heads" on the other hand still lists the ref for the 
>> last
>> branch commit.
>>
>> If I delete the branch using "git push origin :<branch>" the branch 
>> is
>> removed completely (i.e. git ls-remote  no longer returns a ref).
>
> All of the above are expected and working as designed.  Remote
> tracking branches are local _copies_ of what you have over there at
> the remote repository. The latter is the authoritative version, and
> you asked "ls-remote" to go over the network to view them.
>
Is there a definitive naming convention for the two types of 'remote 
branch'?

IIRC (somewhere) the 'tracking' term was to be deprecated, though it is 
still in common use. It is usually only the context that clarifies if it 
is the local or the distant copy/repo.

Distinct names make for less confusion.

> If you are trying to remove the branches you show to others and
> yourself who are observing that remote repository from your local
> workstation, you can first "git push origin :<branch>" to remove it
> in the remote repository. You can run your next fetch with "--prune"
> to get rid of remotes/origin/<branch>, I think.
>

Philip 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Deletion of remote branches
  2012-10-01 20:12   ` Philip Oakley
@ 2012-10-01 20:42     ` Junio C Hamano
  2012-10-02  6:57       ` Jens Hausherr
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2012-10-01 20:42 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Jens Hausherr, git

"Philip Oakley" <philipoakley@iee.org> writes:

>> All of the above are expected and working as designed.  Remote
>> tracking branches are local _copies_ of what you have over there at
>> the remote repository. The latter is the authoritative version, and
>> you asked "ls-remote" to go over the network to view them.
>>
> Is there a definitive naming convention for the two types of 'remote 
> branch'?
>
> IIRC (somewhere) the 'tracking' term was to be deprecated, though it is 
> still in common use. It is usually only the context that clarifies if it 
> is the local or the distant copy/repo.

That is somewhat different from what I recall:

 - "refs/remotes/$there/$that" is a copy of $that branch at the
   remote $there; we call that a "remote tracking branch".

   When people say "remote branch", they often mean $that branch at
   the remote $there, not your local copy of it.

   When you say "remote tracking branch", you are talking about
   something you locally have to track the corresponding "remote
   branch".  This use is not deprecated at all.  That is the only
   sane way to clarify which one of the two you are talking about.

 - If your branch "foo" always integrates with branch "bar" at the
   remote "xyzzy", you would often run

	git pull xyzzy bar
        git pull --rebase xyzzy bar

   after running "git chekcout foo".  You may even have this in your
   per-repository configuration:

	[branch "foo"]
		remote = xyzzy
                merge = refs/heads/bar

   In such a situation, some people (used to) say that "foo tracks
   bar from xyzzy".  While such a colloquial use is perfectly fine
   when it is clear that "foo" being discussed is your local branch,
   the verb "track" in that sentence is used to mean an entirely
   different kind of relationship between your "remotes/xyzzy/bar"
   and the branch "bar" at remote "xyzzy", where the former is the
   "remote tracking branch" for the latter, leading to confusion.
   This use of 'track' is what is discouraged these days.

I think we call the latter @{upstream} of "foo" these days.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Deletion of remote branches
  2012-10-01 20:42     ` Junio C Hamano
@ 2012-10-02  6:57       ` Jens Hausherr
  0 siblings, 0 replies; 5+ messages in thread
From: Jens Hausherr @ 2012-10-02  6:57 UTC (permalink / raw)
  To: Junio C Hamano, Philip Oakley; +Cc: git

Ok, thanks for clarifying this.


"Philip Oakley" <philipoakley@iee.org> writes:

>All of the above are expected and working as designed.  Remote
>tracking branches are local _copies_ of what you have over there at
>the remote repository. The latter is the authoritative version, and
>you asked "ls-remote" to go over the network to view them.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-02  7:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-01 13:22 Deletion of remote branches Jens Hausherr
2012-10-01 17:22 ` Junio C Hamano
2012-10-01 20:12   ` Philip Oakley
2012-10-01 20:42     ` Junio C Hamano
2012-10-02  6:57       ` Jens Hausherr

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).