terra
terra

Reputation: 75

How to query git logs at git server?

I know I can use

git log

to query logs at local.

But I want to execute a linux command at git server'repository to query logs.

Is there such a similar command I can use at git server?

Upvotes: 4

Views: 1653

Answers (2)

ElpieKay
ElpieKay

Reputation: 30938

If you are allowed to log in to the server by ssh, you can use ssh to run git log.

Suppose the repository in the server is at /path/to/foo.git.

ssh ${user}@${server_ip} git --git-dir=/path/to/foo.git log ${branch}

Upvotes: 2

Maroun
Maroun

Reputation: 96008

You need to first update the remote-tracking branches and then check the log:

git fetch && git log origin/<branch> --name-status --pretty=...

Read more about git-fetch and git-log to understand how they work.

Upvotes: 1

Related Questions