isomorphic-git: can't clone gists

I followed the API and apparently I can’t clone gists.

This is my code:

await git.clone({
  fs,
  dir: '/tmp/test',
  ref: 'master',
  url: 'https://gist.github.com/f55e5fc30238c672621f56aba653904c.git'
})

It does clone the gist repo but only populates it with the .git directory. I could then git.pull to get the file too but that’s not how cloning works.

If I use the isomorphic-git repo address as url it works as expected.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (14 by maintainers)

Commits related to this issue

Most upvoted comments

In chrome you can’t even use XHR to set user-agent. I’ve delete fetch before including isomorphic-git so it get xhr instead of fetch and I’ve got error request.js:194 Refused to set unsafe header "user-agent".

Will set up my proxy to include that user-agent. thanks for the tip.

great, works as expected now. Thank you.

🎉 This issue has been resolved in version 0.17.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Confirmed. For some reason, Github is returning 404 Not Found errors for service discovery attempts requests to gists if the User-Agent string does not start with git/. Regular Github repos only require the User-Agent string for the second HTTP request which does the actual cloning. I guess we’ll need to send the User-Agent for both of them. 😕