We use the git http(s) protocol (https://www.git-scm.com/docs/http-protocol; smart service) to get all branches from a repository on e.g. GitHub or BitBucket like this:
GET https://github.com/larshp/abapgit.git/info/refs?service=git-upload-pack
The response gives us a list of all branches within the given repository.
Now we need to confirm that a given commit is existent in a specific branch. Also it would be nice if we could get a list of commits by a given branch via the git http procotol. How does such requests have to be specified? Many thanks in advance for the help!
Related to: Revert to any single Commit #3040
If you want to inspect the history of a branch, including the commits it contains, you'll need to clone the repository.
The Git smart HTTP protocol is designed to (a) enumerate branches, tags, and other refs and (b) exchange objects after negotiating which objects each side has. It doesn't provide options to query the remote data, since there are many ways to do so, some of which are very expensive.
It is possible that your server implementation (GitHub or Bitbucket) may provide some of those features through an independent API, but usually traversing the history of a branch is not very efficient over the API because it takes many requests, which is slow and will usually get you rate limited. Cloning is the fastest way to get this information.