I think you are trying to transfer some assumptions from Subversion that are not valid for git. Git is a decentralized version control system, so all commandsΒΉ work against your local repository clone, not from a remote server. In addition, there is no single linear commit history in git, so you need to specify SHA-1 commit identifiers; you cannot just use version numbers.
To get the log, you must first transfer the commits to the local repository clone, and then you can request them.
If you have not cloned the remote repository yet, you need to run git clone REMOTE_URL . Alternatively, if you want to use an additional remote server, you can run git remote add ALIAS OTHER_REMOTE_URL in the existing repository.
Then you need to get commits using git fetch origin (or git fetch ALIAS if you added an additional remote server).
Once you do this, you can list the commits (in branches in the remote repository) using git log origin/master~5..origin/master (for example, to display the last five commits). Or you can run git log master..origin/master to show new remote commits that have not yet been merged locally. (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 , are executed on a remote server, but most do not.
Bradley grainger
source share