In Git 1.7.?
, push.default
has value : nothing, matching, tracking ...
In Git 1.8.?
, push.default
has value : nothing, upstream, simple ...
I custom my .gitconfig
file :
[push]
default = simple
and this will not work in Git 1.7, so I want to to check the git version
and choose which push.default value to use.
There is a similar question: Can gitconfig options be set conditionally?
the answer is use script, is there any other better way?
And I use git --version
, and output this format:
git version 1.8.1.5
Is there a way to check the version?