4

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?

terra
  • 75
  • 7

2 Answers2

2

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}
ElpieKay
  • 27,194
  • 6
  • 32
  • 53
  • This help me. I use ' git --git-dir=/path/to/foo.git log ' at git sever' repo and it is success. – terra Apr 23 '19 at 09:01
1

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.

Maroun
  • 94,125
  • 30
  • 188
  • 241
  • Thanks.But I want to execute a linux command at git server to query logs directly.Your idea is also a good one. – terra Apr 23 '19 at 08:07