"So, while diesel fuel contains slightly more carbon (2.68kg CO₂/litre) than petrol (2.31kg CO₂/litre), overall CO₂ emissions of a diesel car tend to be lower. In use, on average, this equates to around 200g CO₂/km for petrol and 120g CO₂/km for diesel."
That article makes the assumption that the ethanol component of finished motor gasoline has net zero carbon emissions.
https://theconversation.com/fact-check-are-diesel-cars-reall...
"So, while diesel fuel contains slightly more carbon (2.68kg CO₂/litre) than petrol (2.31kg CO₂/litre), overall CO₂ emissions of a diesel car tend to be lower. In use, on average, this equates to around 200g CO₂/km for petrol and 120g CO₂/km for diesel."