I'm using the following to create a CSV file of my commit history to be seen in Microsoft Excel.
git log --since='last month' --pretty=tformat:"%an, %s" --author=Jorge > "Jorge.csv"
The problem is that some commit subjects have commas in them. So when I use %s
to get the commit subjects (AKA commit messages), the commas in them cause commit subjects to be split into different cells (e.g. the subject "Added the ability to dash, wall jump, and wall climb in the game" gets split into 3 cells in Excel but I want it to be 1 single cell).
How can I get the git log command to escape the commas inside %s
so that commas show in excel instead of splitting the subject?
I want the output to be:
| Jorge | Added the ability to dash, wall jump, and wall climb in the game |
where |
represents the cells in Excel
So when I use
%s
to get the commit subjects (AKA commit messages), the commas in them cause commit subjects to be split into different cells
It should not: you can open a csv file in Excel with a different separator (different than ',
')
As shown here, you have the choice:
So instead of "%an, %s"
, consider for instance ';
' or tab.