[Top][All Lists]

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

Re: Git help: amending a substandard commit message in savannah.

From: David Kastrup
Subject: Re: Git help: amending a substandard commit message in savannah.
Date: Mon, 23 Nov 2015 21:17:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

David Caldwell <address@hidden> writes:

> On 11/23/15 3:32 AM, David Kastrup wrote:
>> So you can use
>>     git push origin :branch_to_be_deleted
>> in order to delete the branch, but once it is gone, you need to do
>>     git push origin HEAD:refs/heads/branch_to_be_deleted
>> in order to recreate it (after which it is again possible to refer to it
>> using just branch_to_be_deleted).
> Er, what? That's not right. Once you've deleted a branch on the remote
> git server you can just push it back using whatever command you created
> it with in the first place. Of course the commands you gave will work,
> but it's over-complicating things certainly not required. You can do
> this all day:
>     git push origin :branch_to_be_deleted
>     git push origin branch_to_be_deleted

_Iff_ the reference you push has the name branch_to_be_deleted in the
first place.  If you name the reference explicitly, namely if your
pushing command contains a : sign, then you need the full reference name
on the right side of the :.  If you only name one reference, then the
disambiguation used for finding the reference in the local repository
will be pushed to the remote side.


    git push origin HEAD:branch_to_be_deleted

to see what I mean.  Or even

    git push origin branch_to_be_deleted:branch_to_be_deleted

David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]