Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

URL of GitHub Enterprise API is different from github.com's one

Problem:

I have tried to access GitHub Enterprise API with a URL like showed below, based on examples from some websites, but the response was 404 error.

https://x.x.x.x/repos/Project/Repository/git/refs/heads

Reason:

URL of GitHub Enterprise API is different from github.com’s one. github’s API URL is like:

https://api.github.com/repos/User/Repository/git/refs/heads

and GitHub Enterprise API URL is like:

https://x.x.x.x/api/v3/repos/Project/Repository/git/refs/heads

Solution:

Fix the URL and got response successfully.