githash

How to get SHA1 hash from a git repository without cloning?


If U is a git URL (e.g., an ssh URL), how can I find the SHA1 hash of a branch or tag of U without a local clone of U?


Solution

  • You can get heads (branches) and tags with git ls-remote U.