I am trying to build a workflow which syncs to a remote git repo, with as little overhead as possible. Some of the repos I want to sync are quite large and I don't need the history (--depth 1). The real issue is that I want to sync to any of: a branch, a tag, a SHA.
I can't clone at a SHA, as far as I can tell.
Then I read this wonderful comment: Retrieve specific commit from a remote Git repository
It suggests that git fetch <remote> <sha>
works. Empirically it works on file:// repos and on GitHub repos. My question is really: can I rely on this? Or are there reasons that major providers might disable this?