10

I have been asked to make a log of all the pushes made to a remote repository during a working day to display along side our build information. I am having trouble getting the necessary information for the remote repository.

I can get the info in relation to my local version of the repository with "$git log", and I have come close with the command "$git reflog show origin/master" on the remote but the main problem here is that it shows no details.

My remote repository is hosted on BitBucket. I am trying to get the list of files that have been pushed and the commit message associated with that push, across the whole day. Is this possible?

Zombo
  • 1
  • 62
  • 391
  • 407
Gniuz
  • 103
  • 1
  • 5
  • Have you tried looking at Bitbucket API? This looks like something that can suite your needs: https://confluence.atlassian.com/display/BITBUCKET/changesets+Resource#changesetsResource-GETalistofchangesets – Archeg May 01 '13 at 09:11

2 Answers2

11
git log origin

This will give you a log of commits on the origin remote.

git-log(1)

Zombo
  • 1
  • 62
  • 391
  • 407
  • 1
    Be aware that a commit is different from a push! git log only shows you commits. It does not show you who pushed the commit and when. (There usually are many potentially old commits in a single push from today.) – michas May 01 '13 at 10:44
  • 5
    This command also only lists commits that have been fetched. It does not actually contact the remote. – lionello Jan 16 '19 at 08:34
6

You have first to fetch the remote branch into your local remotes/origin. Then you can log this. For instance, if you are working on branch master:

git fetch
git log FETCH_HEAD

This will now show you the log from remotes/origin/master on your local machine.

Christian Schulzendorff
  • 1,431
  • 1
  • 18
  • 15
  • 1
    is there any means to actually query the remote server from a local context _without_ fetching even a bare repo? In other words is there a means to run a `git log` or `git diff` command on the remote that leaves no trace on the local file system? – jxramos Sep 05 '19 at 04:41