How to git log from all branches for the author at once?

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.

  • How can I see the git command command output in my Jenkins Console Log for a build?
  • How to see remote changes to branches in Git?
  • Is it possible to get a simple numeric revision number from Git?
  • Git, How to make my develop mirror/clone my master branch?
  • How do I move the contents of my master branch to a new Git branch?
  • How can I clean up a broken history with git-tfs
  • including the .git folder when running git archive
  • git add -p in Windows Git Shell, child_info_fork::abort
  • 2 Solutions collect form web for “How to git log from all branches for the author at once?”

    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.

    Instead of --all you may want to use --branches, since --all also includes refs/tags and refs/remotes.

    Git Baby is a git and github fan, let's start git clone.