从远程Git仓库获取最新的提交记录

// 获取默认分支的最新提交记录
git ls-remote $URL HEAD

// 获取指定分支的最新提交记录
git ls-remote $URL refs/heads/master

Link: