Re: How to do a fast-forward merge without a checkout?

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

 



On Mon, Jul 18, 2011 at 11:08 AM, Johannes Sixt <j.sixt@xxxxxxxxxxxxx> wrote:
> Am 7/18/2011 16:18, schrieb Patrick Doyle:
>> $ git push
> ...
>> To somehost:path/to/repo
>>    e1004df..bad8767  wpd -> wpd
>>  ! [rejected]        master -> master (non-fast-forward)
>
> [Context: Patrick works on the topic branch, but can't push it anymore
> because the unrelated branch master was moved forward by someone else.]
>
> After the obligatory 'git fetch', there are at least two ways to do this:
>
> (1) The quick and unsafe way:
>
>    $ git branch -f master origin/master
>
> (2) The safer way:
>
>    $ git push . origin/master:master
>
> The second command is safer because it checks that origin/master is indeed
> a direct descendent of master.

I like it!  (#2) It's obscure as all get-out, as UNIX commands were
intended to be, does the job you need it to do in a manner that is
intuitive, provided you understand what it's doing, and if you miss
the dot (perhaps, hypothetically speaking of course, because you
thought it was a dust spec on your screen when you tried out the
command), you get a very obscure error message (errr, hypothetically
speaking of course).

Seriously... Thanks for the quick answers.  I'll tuck #2 into my bag
o' tricks.  In the mean time, I need to decide whether I really care
about my master branch or not.  I do care about origin/master, but I
do all my work on wpd and merge in changes from origin/master at
random points in time.

Thanks again.

--wpd
--
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]