Re: Is there a "git reset --keep <sha1> || git reset --hard <sha1>" alternative?

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

 



On Wed, Apr 20, 2016 at 9:03 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes:
>
>>     $ ls -l INSTALL ; chmod 600 INSTALL ; git reset --hard @{u} ; ls -l INSTALL
>>     -rw-r--r-- 1 avar avar 9147 Apr 20 17:11 INSTALL
>>     HEAD is now at e6ac6e1 Fifth batch for post 2.8 cycle
>>     -rw-r--r-- 1 avar avar 9147 Apr 20 17:12 INSTALL
>
> A quick question.  What happens when you did this instead?
>
>         chmod 600 INSTALL
>         git update-index --refresh
>         git reset --hard
>
> Does it match what you want to see?
>
> The reason I ask is because I recall making a deliberate design
> decision around this area.

The --hard doesn't wipe away the chmod, makes sense:

    $ ls -l INSTALL ; chmod 600 INSTALL ; git update-index --refresh;
git reset --hard @{u} ; ls -l INSTALL
    -rw-r--r-- 1 avar avar 9147 Apr 20 22:27 INSTALL
    HEAD is now at 05045e0 tracing
    -rw------- 1 avar avar 9147 Apr 20 22:27 INSTALL
--
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]