【发布时间】:2021-03-30 19:57:42
【问题描述】:
我正在尝试使用 git log pretty format 命令将日志输入到 json 文件中。目前我正在使用这个命令来获取特定的 git 属性:
git log --pretty="format:{commit:%h,%n merge:%p,%n author:%an,%n title:%s,%n body:%b,%n}">git_log.json
这个命令的问题是它获取系统中所有分支的日志并输入到json中。我只想用这个命令输入某个分支的日志,我可以通过某种方式输入。
我尝试检查我想要注销的某个分支,然后使用该命令但它不起作用,因为它仍然显示所有现有分支的日志。这是我在 cmd 行中的失败尝试:
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
但它也给了我其他分支的日志文件。 如何仅获取分支 robots/ashish_c/infrastructure 的漂亮格式日志文件?
【问题讨论】: