Put git pull code in function as it will be used twice