`git branch` upstream-setting fixes

also helper script for checking installed `git` version
This can be written more simply as:

```python
version_output = subprocess.check_output(['git', '--version'])
```