Commit history on remote repository

user1795998 picture user1795998 · Dec 18, 2012 · Viewed 195.3k times · Source

I am trying to access a branch's commit history on a remote repository. I had a look at the doc but could not find any substantial information on how to access a remote repo's commit history using my local git client.

Answer

LopSae picture LopSae · Dec 19, 2012
git log remotename/branchname

Will display the log of a given remote branch in that repository, but only the logs that you have "fetched" from their repository to your personal "copy" of the remote repository.

Remember that your clone of the repository will update its state of any remote branches only by doing git fetch. You can't connect directly to the server to check the log there, what you do is download the state of the server with git fetch and then locally see the log of the remote branches.

Perhaps another useful command could be:

git log HEAD..remote/branch

which will show you the commits that are in the remote branch, but not in your current branch (HEAD).