Add API endpoints to tinker with git references #5531

Open
opened 2025-11-02 06:27:58 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @tle-huu on GitHub (Jun 10, 2020).

Originally assigned to: @richmahn on GitHub.

GitHub does have some API endpoints to create, update, or get references: https://developer.github.com/v3/git/refs/

These endpoints can be useful for users to recreate some git "plumbing" functionalities over the Gitea API. With these endpoints, users could reset branches for example.

More generally, GitHub has a "Git Database API" which works at a lower level and allows user to do almost anything, but that might be a bigger project: https://developer.github.com/v3/git/

Originally created by @tle-huu on GitHub (Jun 10, 2020). Originally assigned to: @richmahn on GitHub. GitHub does have some API endpoints to create, update, or get references: https://developer.github.com/v3/git/refs/ These endpoints can be useful for users to recreate some git "plumbing" functionalities over the Gitea API. With these endpoints, users could reset branches for example. More generally, GitHub has a "Git Database API" which works at a lower level and allows user to do almost anything, but that might be a bigger project: https://developer.github.com/v3/git/
GiteaMirror added the issue/confirmedmodifies/api labels 2025-11-02 06:27:58 -06:00
Author
Owner

@stale[bot] commented on GitHub (Aug 16, 2020):

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale[bot] commented on GitHub (Aug 16, 2020): This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Aug 31, 2020):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Aug 31, 2020): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Author
Owner

@richmahn commented on GitHub (Aug 15, 2022):

Seems to be the same as https://github.com/go-gitea/gitea/issues/16208

Github doesn't even have a create branch API endpoint like Gitea has, but just relies on a covers-all create reference API end point:

https://docs.github.com/en/rest/git/refs#create-a-reference

This and the update reference are needed.

@richmahn commented on GitHub (Aug 15, 2022): Seems to be the same as https://github.com/go-gitea/gitea/issues/16208 Github doesn't even have a create branch API endpoint like Gitea has, but just relies on a covers-all create reference API end point: https://docs.github.com/en/rest/git/refs#create-a-reference This and the update reference are needed.
Author
Owner

@richmahn commented on GitHub (Oct 3, 2022):

Currently still working on this. Writing unit tests.

@richmahn commented on GitHub (Oct 3, 2022): Currently still working on this. Writing unit tests.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5531