`git branch` upstream-setting fixes

also helper script for checking installed `git` version
regex pro tip: `\d` is an alias for `[0-9]`, and you can use `r''` in Python to avoid having to escape the `\`:

```python
version_regex = r'git version ((?:\d+\.)*\d+)'
```