Re: How to use @{-1} with push?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 25, 2016 at 1:02 PM, Robert Dailey <rcdailey.lists@xxxxxxxxx> wrote:
> On Fri, Mar 25, 2016 at 12:45 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> You can ask rev-parse to give you --symbolic-full-name, error out if
>> it is empty (i.e. detached HEAD), and otherwise use the result, no?
>>
>>     $ git checkout next
>>     $ git checkout master
>>     $ git rev-parse --symbolic-full-name @{-1}
>>     refs/heads/master
>>     $ git checkout HEAD^0
>>     $ git checkout master
>>     $ git rev-parse --symbolic-full-name @{-1}
>>     $ exit
>>
>> And
>>
>>     $ git push origin :refs/heads/master
>>
>> would be the fully-spelled out way to remove that branch.
>
> Thanks Junio, I figured there was a command to do that. I tried to do
> this using '-' shorthand, but that didn't work. I guess because that's
> not really a revision, but a special function of git checkout only.

So the push works with the fully-qualified ref, but not git branch:

$ git rev-parse --symbolic-full-name foo
refs/heads/foo

$ git branch -d refs/heads/foo
error: branch 'refs/heads/foo' not found.

Any reason for this? I'm using git 2.7.4 on windows
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]