Skip to main content
Jul 6, 2020 1:10 PM UTC

Trying a git reset HEAD --hard .... and failing

After a pull i decided to reverse it using: git reset HEAD --hard and got the message:

fatal: Cannot do hard reset with paths.

This makes no sense to me as:

  1. I’m in the subdirectory where the git repository resides
  2. there are no git repositories higher in the directory chain
  3. a co-worker got it to work

Please advise

    6 replies

    Tatiana Balaburkina
    Rocketeer
    Jul 6, 2020 2:39 PM UTC

    After a pull i decided to reverse it using: git reset HEAD --hard and got the message:

    fatal: Cannot do hard reset with paths.

    This makes no sense to me as:

    1. I’m in the subdirectory where the git repository resides
    2. there are no git repositories higher in the directory chain
    3. a co-worker got it to work

    Please advise

    Is that helpful?

    Jul 6, 2020 3:29 PM UTC

    After a pull i decided to reverse it using: git reset HEAD --hard and got the message:

    fatal: Cannot do hard reset with paths.

    This makes no sense to me as:

    1. I’m in the subdirectory where the git repository resides
    2. there are no git repositories higher in the directory chain
    3. a co-worker got it to work

    Please advise

    What my co-worker did he wasn’t able to recreate and when I tried exactly what he did it didn’t work.

    He then did something on his Linux box with a ‘git restore’ which i don’t see on z/OS.

    Vladimir Ein
    Rocketeer
    Jul 23, 2020 3:36 PM UTC

    After a pull i decided to reverse it using: git reset HEAD --hard and got the message:

    fatal: Cannot do hard reset with paths.

    This makes no sense to me as:

    1. I’m in the subdirectory where the git repository resides
    2. there are no git repositories higher in the directory chain
    3. a co-worker got it to work

    Please advise

    Hello Lionel,

    The restore command was added in Git 2.23.0, whereas the latest release of Git on z/OS is 2.14.4. We’re going to update Git in Q3 2020.

    Regards,
    Vladimir

    Jul 23, 2020 3:50 PM UTC

    Hello Lionel,

    The restore command was added in Git 2.23.0, whereas the latest release of Git on z/OS is 2.14.4. We’re going to update Git in Q3 2020.

    Regards,
    Vladimir

    Q3 2020 - perfect. We’re in Q3 2020 now - looking forward to it. Any more firm date or just sometime prior to Sept 30?

    Vladimir Ein
    Rocketeer
    Jul 24, 2020 6:10 AM UTC

    Q3 2020 - perfect. We’re in Q3 2020 now - looking forward to it. Any more firm date or just sometime prior to Sept 30?

    Hello Lionel,

    Sorry, I can’t give a better estimate right now.

    Regards,
    Vladimir

    Jul 24, 2020 6:28 AM UTC

    Hello Lionel,

    Sorry, I can’t give a better estimate right now.

    Regards,
    Vladimir

    no worries - i can be patient