update script so that it detects git branches