You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/v3/git/refs.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,27 @@ title: Git Refs
13
13
The `ref` in the URL must be formatted as `heads/branch`, not just `branch`. For example, the call to get the data for a branch named `skunkworkz/featureA` would be:
14
14
15
15
GET /repos/:owner/:repo/git/refs/heads/skunkworkz/featureA
16
-
17
-
If the `ref` doesn't exist in the repository, but existing refs start with `ref` they will be returned as an array.
18
-
19
-
### Response
20
16
21
17
<%= headers 200 %>
22
18
<%= json :ref %>
23
19
20
+
If the ref doesn't exist in the repository, but existing refs start with ref
21
+
they will be returned as an array. For example, a call to get the data for a
22
+
branch named `feature`, which doesn't exist, would return head refs
23
+
including `featureA` and `featureB` which do.
24
+
25
+
GET /repos/:owner/:repo/git/refs/heads/feature
26
+
27
+
<%= headers 200 %>
28
+
<%= json :refs_matching %>
29
+
30
+
If the ref doesn't match an existing ref or any prefixes a 404 will be returned.
31
+
32
+
GET /repos/:owner/:repo/git/refs/heads/ref-that-like-for-sure-totally-doesnt-exist
0 commit comments