I would like to know if I can easily get the last commit sha from a remote repository and a specific branch.
I could do a
git fetch MY_REMOTE_REPO;git checkout BRANCH_X;git log -1; but it is heavy just to get a SHA string.
I would like to know if I can easily get the last commit sha
Share
The
ls-remoteplumbing command does exactly this. For example, to see the sha1 of the currentmasterbranch in the Linux kernel: