Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List git commits to master branch between two dates

Tags:

git

git-log

How can i get a list of all the git commits done to the master branch between 2014-01-01 and 2014-06-30?

I know git log will give me roughly this format (repeated for all commits):

commit <hash> author: <author name> date: <date> <comment> 

But how can it be limited to selected dates and a one line per commit format?

<hash> <author> <date> <hash> <author> <date> 
like image 271
Aksel Willgert Avatar asked Dec 05 '14 10:12

Aksel Willgert


People also ask

How do I find commits between two branches?

In order to see the commit differences between two branches, use the “git log” command and specify the branches that you want to compare. Note that this command won't show you the actual file differences between the two branches but only the commits.

How do I see commits in master branch?

To confirm, you can run git branch . The branch that you are on will be the one with a * next to it. Git checkout might fail with an error message, e.g. if it would overwrite modified files. Git branch should show you the current branch and git log master allows you to view commit logs without changing the branch.

How do I see the commit history of a branch?

On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.

Which command gets the list of commits made in the last 2 weeks?

The most basic and powerful tool to do this is the git log command. By default, with no arguments, git log lists the commits made in that repository in reverse chronological order; that is, the most recent commits show up first.


1 Answers

$ git log --since "DEC 1 2014" --until "DEC 5 2014" --pretty=format:"%h %an %ad" 

This will give the format you want for the commits between dec 1 2014 and dec 5 2014, you can change the dates as you like

If you wish to change the format, you can read about the options here

like image 75
Tim Avatar answered Oct 10 '22 11:10

Tim