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.
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.
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>".
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 .
git log -p command displays the patch representing each commit.
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.
git log <hash>..
Is the least amount of typing. Omitting "HEAD" assumes that's what you meant. Rev-list would work too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With