Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a list of commits along with the commit message and hash in Git

Tags:

git

I have a project in Git. What I want is a list of only the commit messages and the hashes between two commits and store it in a text file. Is there any command that does this ?

Thanks.

like image 655
naiquevin Avatar asked Jul 15 '11 05:07

naiquevin


People also ask

How do I make a commits list?

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.

How do I view commit hashes?

If you have the hash for a commit, you can use the git show command to display the changes for that single commit. The output is identical to each individual commit when using git log -p .

What is the command to view all the commits made by a specific person?

The git log command displays all of the commits in a repository's history.

How do you check all commits in a branch?

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.


1 Answers

git log --pretty=oneline commit1...commit2 > file 
like image 60
Noufal Ibrahim Avatar answered Sep 23 '22 17:09

Noufal Ibrahim