Assume that foo.txt is in the index.
foo.txt
Why doing:
git reset foo.txt
returns 1:
$ echo $? 1
?
git reset foo.txt returns zero when foo.txt has no unstaged changes after the reset, and one when it does.
This allows scripting code to determine if the file in question has been modified since the last commit.
Copyright © 2021 Jogjafile Inc.
git reset foo.txt
returns zero whenfoo.txt
has no unstaged changes after the reset, and one when it does.This allows scripting code to determine if the file in question has been modified since the last commit.