How to get the last commit ID of a remote repo using curl-like command?

前端 未结 6 863
我寻月下人不归
我寻月下人不归 2020-12-12 19:38

I want to get the last commit ID of the remote git repo.

The command git rev-parse HEAD works for a locally-cloned git repo, but I want

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 19:59

    You can use git ls-remote for this. Because I get a 'Unauthorized access for repository apiapp.git' I use as example torvalds linux-repo.

    $ git ls-remote --heads git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
    6d15ee492809d38bd62237b6d0f6a81d4dd12d15        refs/heads/master
    

提交回复
热议问题