Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list commits since certain commit?

Tags:

git

Is there anyway to get a list of commits from a given commit number to HEAD?

I know this is possible by the commit date, but I need it by the commit number and I can't seem to find any documentation, or even if this is possible.

like image 931
ehftwelve Avatar asked Oct 07 '11 21:10

ehftwelve


People also ask

How do I list previous commits?

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.

How do I see commits in a specific file?

On Linux you can use gitk for this. It can be installed using "sudo apt-get install git-gui gitk". It can be used to see commits of a specific file by "gitk <Filename>".

Which command is used to check last 5 commits by a particular?

If you're limiting the number of commits to output within a script, you should be kind to others and use the long option, e.g. git log --max-count=5 .

Which command displays the list of all commits?

git log -p command displays the patch representing each commit.


2 Answers

git rev-list <since_hash>..HEAD 

or to include the commit:

git rev-list <since_hash>^..HEAD 

You can use git log instead of git rev-list as well to get additional details.

like image 142
manojlds Avatar answered Sep 19 '22 08:09

manojlds


git log <hash>.. 

Is the least amount of typing. Omitting "HEAD" assumes that's what you meant. Rev-list would work too.

like image 31
Adam Dymitruk Avatar answered Sep 20 '22 08:09

Adam Dymitruk