I think you're trying to transfer some assumptions from Subversion that aren't valid for git. Git is a decentralized version control system, so all¹ commands run against your local clone of the repository, not against a remote server. Also, in git, there isn't one single linear history of commits, so you need to specify SHA-1 commit IDs; you can't simply use revision numbers.
To get a log, you must first transfer the commits to your local clone of the repository, and then you can query them.
If you haven't already cloned the remote repository, you will need to run git clone REMOTE_URL
. Alternatively, if you're wanting to use a secondary remote server, you can run git remote add ALIAS OTHER_REMOTE_URL
in an existing repository.
You'll then need to fetch the commits with git fetch origin
(or git fetch ALIAS
if you've added a secondary remote server).
Once you've done that, you can list commits (on branches in the remote repository) with git log origin/master~5..origin/master
(to show the last five commits, for example). Or you could run git log master..origin/master
to show the new remote commits that haven't been merged locally yet. (There are many other ways to specify commit ranges; for more information see the documentation or open another question.)
- Some commands, such as
git ls-remote
do run against a remote server, but the majority do not.