I am trying to use the git log pretty format command to input the log into a json file. Currently I am using this command to get the specific git attributes:
git log --pretty="format:{commit:%h,%n merge:%p,%n author:%an,%n title:%s,%n body:%b,%n}">git_log.json
The problem with this command is that it gets the logs of all the branches in the system and inputs into the json. I only want to use this command to input logs of a certain branch that I can input somehow.
I tried checking out the certain branch that I want to get the log off and then used that command but it did not work as it still showed logs of all the existing branches. This was my failed attemmpt in the cmd line:
git checkout robotics/ashish_c/infrastructure git fetch git log --pretty="format:{commit:%h,%n merge:%p,%n author:%an,%n title:%s,%n body:%b,%n}">git_log.json
But it gave me the log files of other branches as well. How do I only get the pretty format log file of only the branch robotics/ashish_c/infrastructure ?
https://stackoverflow.com/questions/65386246/git-log-pretty-format-for-a-certain-branch December 21, 2020 at 08:40AM
没有评论:
发表评论