`git restore` requires `git --version` ≥ 2.23.0 or later
LucasLarson opened this issue · 5 comments
LucasLarson commented
Line 29 in ecffcba
git restore
is not available before Git 2.23.0
LucasLarson commented
Either:
- use old Git syntax, or
- add the limitation to the readme.
LucasLarson commented
add the limitation to the readme
and if adding the limitation, then check the user’s Git version à la ohmyzsh/ohmyzsh@c549387
LucasLarson commented
and this is arguably better: it returns only the numerical output of git version
printf '%s\n' "$(git --version | awk '{print $3}')"
LucasLarson commented
printf '%s\n' "$(git --version | awk '{print $3}')"
but it doesn’t actually work
LucasLarson commented
but this appears to work:
if (printf 'minimum version 2.23.0\n'; git --version) | sort --version-sort --key=3 | tail -n -1 | grep --quiet git; fi