如何一次从作者的所有分支登录? [英] How to git log from all branches for the author at once?

查看:102
本文介绍了如何一次从作者的所有分支登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要得到作者所做的所有提交的报告。到目前为止,我的脚本包装了以下命令:

  git log --pretty = format:%ad:% a:%d:%B--date = short --reverse --all --since = 2.months.ago --author = Petr 

它工作正常。但是,它只报告当前分支的操作​​。是否有任何选项可以记录来自所有分支的作者的提交消息,而不仅仅是当前的分支?



换句话说,可以让git对存储库中所有提交进行反向排序(按日期时间)序列,并从该序列中提取日志信息?

已解决: (从下面的评论复制,否则隐藏)

问题是我有一个存储库和两个克隆在两个分支上一致地工作。我确实将更改推送到源存储库,但我忘记了对克隆存储库的更改。这样看来, - all 在将其用于克隆存储库时不起作用。

解决方案

您的命令是正确的,因为您使用 - all 开关,该开关提供所有分支的所有提交。要回答您的评论中的问题,它也可以在裸仓库中使用。


I need to get the report of all commits that the author did. So far, I have the script that wraps the following command:

git log --pretty=format:"%ad:%an:%d:%B" --date=short --reverse --all --since=2.months.ago --author=Petr

It works fine. However, it reports only the actions for the current branch. Is there any option that would log the commit messages for the author from all branches, not only form the current one?

In other words, can git make a reverse sorted (by datetime) sequence of all the commits in repository and extract the log info from that sequence?

Solved: (copied from the comment below that is hidden otherwise)

The problem was that I have one repository and two clones to work concurently on two branches. I did push the changes to the origin repository, but I forgot to fetch the changes to the cloned repository. This way it seemed that --all did not work when using it for the cloned repository.

解决方案

Your command is right, since you use the --all switch which gives all commits from all branches. To answer the question in your comment, it works also in bare repositories.

这篇关于如何一次从作者的所有分支登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆