Re: Is there a "git reset --keep <sha1> || git reset --hard <sha1>" alternative?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 20, 2016, 19:03 UTC
- Message-ID
- <xmqqvb3cumpd.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CACBZZX6k6sFv2GWOzu0Ow1T+5ci2gmMOvaD37bvbm1_qfetr8Q@mail.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> 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 INSTALLA quick question. What happens when you did this instead?
chmod 600 INSTALL
git update-index --refresh
git reset --hardDoes it match what you want to see?
The reason I ask is because I recall making a deliberate design decision around this area.