Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show git logs for range of commits on remote server?

Tags:

git

logging

I am looking for a way to query a git server for its logs for a given range of commits. Being an SVN user, I'm in the wrong mindset so Im hoping GIT experts can help. I'm looking to something similar to:

svn log -r 5:20 --xml svn.myserver.com

but for a git server. In other words, show me the logs for the 5th commit through to the 20th commit. thanks for any help.

like image 382
D.C. Avatar asked May 11 '11 03:05

D.C.


People also ask

How do I see more commits in git log?

For example, if you want to see only 1 commit in your git log or you want to see 2 commits or it can be any number depending on the total number of commits you have done in your git repository. The command for that would be git log -n where n represents the number up to which commit you to want to see the logs.

How do I see all commits on a repository?

On GitHub, you can see the commit history of a repository by: Navigating directly to the commits page of a repository. Clicking on a file, then clicking History, to get to the commit history for a specific file.

How do I view the commit log?

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.

Does git log show all branches?

Many times it's useful to know which branch or tag each commit is associated with. The --decorate flag makes git log display all of the references (e.g., branches, tags, etc) that point to each commit.


1 Answers

First, since there is no simple revision number with Git, you would specify revision as mentioned in the rev-parse command.

But the only command which queries directly a remote repo (without cloning or fetching data) is git ls-remote, and:

  • it will display only SHA1, not the log message.
  • it works on ref patterns (head, tags, branches, ...), not with revs.

Since log can show diffstats and full diffs, you cannot ask for logs without at least fetching a remote in a local repo.

like image 70
VonC Avatar answered Oct 05 '22 13:10

VonC