Open-source Languages & Tools for z/OS

 View Only

Git file status modified after git reset --hard

  • 1.  Git file status modified after git reset --hard

    Posted 06-20-2022 09:50
    Our build automation is using git within a shell script.
    We are on git version 2.26.2-78 (zOS 2.4)

    Within the script we run the following steps to reset our local repository:
    git reset --hard
    git status
    and sporadically the git status shows some modified files even if there is nothing modified.
    If I repeat the sequence (reset and status) multiple times the modified status vanishes.
    Sometimes I can even see that the number of modified files decreases between two iterations of
    the sequence.
    If I have a look into one particular file while it is still seen as modified:
    git diff sdk/src/rpcserver/server/xserver.vcxproj
    @@ -1,4 +1,4 @@
    -<?xml version="1.0" encoding="utf-8"?>
    +<?xml version="1.0" encoding="utf-8"?>

    If I have a look into the hexadecimal values before and after the modified status vanishes
    the file has exactly the same content.

    Klaus Sponagel
    Software AG
    Darmstadt DE