git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unable to delete remote branch with a strange name
@ 2010-12-28  7:06 Jingzhao Ou
  2010-12-28  8:40 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Jingzhao Ou @ 2010-12-28  7:06 UTC (permalink / raw)
  To: git

Hi, all,

When I checked out a git repository, it has the following remote branches:

$ git br -r
 origin/HEAD -> origin/master
 origin/master
 origin/dev/main
 origin/remotes/origin/dev/main

I tried to delete the last branch with a strange long name. Using "git push" to 
delete it would fail.

$ git push origin :remotes/origin/dev/main
Pushing to jou@xx.xx.xx.xx:gsfw/omu_fw
error: dst refspec remotes/origin/dev/main matches more than one.
error: failed to push some refs to 'jou@xx.xx.xx.xx:gsfw/omu_fw'

However, I can create a new branch from it:

$ git co -b jou.temp origin/remotes/origin/dev/main
Branch jou.temp3 set up to track remote branch remotes/origin/dev/main
from origin.
Switched to a new branch 'jou.temp3'

But again, I cannot push any changes in "jou.temp3" branch to that weird branch:

$ git push origin HEAD:remotes/origin/dev/main
error: dst refspec remotes/origin/dev/main matches more than one.
error: failed to push some refs to 'jou@xx.xx.xx.xx:gsfw/omu_fw'

I guess somehow, git is confused by "origin/dev/main" and 
"origin/remotes/origin/dev/main". Especially, it cannot identify the latter
properly.

I wonder if any one can give me some suggestions on how to deal with this 
situation.

Thanks a lot!
Jingzhao

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

* Re: Unable to delete remote branch with a strange name
  2010-12-28  7:06 Unable to delete remote branch with a strange name Jingzhao Ou
@ 2010-12-28  8:40 ` Andreas Schwab
  2010-12-28 16:10   ` Jingzhao Ou
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2010-12-28  8:40 UTC (permalink / raw)
  To: Jingzhao Ou; +Cc: git

Jingzhao Ou <jingzhao.ou@gmail.com> writes:

> I guess somehow, git is confused by "origin/dev/main" and 
> "origin/remotes/origin/dev/main". Especially, it cannot identify the latter
> properly.

Try fully qualifying the remote branch (beginning with refs/heads/).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Unable to delete remote branch with a strange name
  2010-12-28  8:40 ` Andreas Schwab
@ 2010-12-28 16:10   ` Jingzhao Ou
  2010-12-28 17:59     ` Tomas Carnecky
  0 siblings, 1 reply; 4+ messages in thread
From: Jingzhao Ou @ 2010-12-28 16:10 UTC (permalink / raw)
  To: git

Andreas Schwab <schwab <at> linux-m68k.org> writes:
> 
> Jingzhao Ou <jingzhao.ou <at> gmail.com> writes:
> 
> > I guess somehow, git is confused by "origin/dev/main" and 
> > "origin/remotes/origin/dev/main". Especially, it cannot identify the latter
> > properly.
> 
> Try fully qualifying the remote branch (beginning with refs/heads/).
> 
> Andreas.
> 

Hi, Andreas,

Yes, using the absolute path works like a champ! 

git push origin :refs/heads/remotes/origin/dev/main

Thanks a lot for your help!

Jingzhao

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

* Re: Unable to delete remote branch with a strange name
  2010-12-28 16:10   ` Jingzhao Ou
@ 2010-12-28 17:59     ` Tomas Carnecky
  0 siblings, 0 replies; 4+ messages in thread
From: Tomas Carnecky @ 2010-12-28 17:59 UTC (permalink / raw)
  To: Jingzhao Ou; +Cc: git

  On 12/28/10 5:10 PM, Jingzhao Ou wrote:
> Yes, using the absolute path works like a champ!
>
> git push origin :refs/heads/remotes/origin/dev/main

Do not use the term 'path' in this context. The fact that a ref looks 
like a path, and can be stored on the filesystem under the same 
directory structure is just an implementation detail. Note the *can*, 
because in the case of packed refs (see man git-pack-refs) the term 
'path' is not even remotely accurate.

We use the term 'fully qualified ref' (see the similarity with 'fully 
qualified domain name') if we want to stress out that the full name of 
the ref is used (refs/heads/foo) instead of an abbreviation (foo).

tom

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

end of thread, other threads:[~2010-12-28 17:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-28  7:06 Unable to delete remote branch with a strange name Jingzhao Ou
2010-12-28  8:40 ` Andreas Schwab
2010-12-28 16:10   ` Jingzhao Ou
2010-12-28 17:59     ` Tomas Carnecky

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 NNTP newsgroup(s).