0

I'm using jsdelivr to point to a javascript file I'm working on in Git. I have done a fair amount of research, mostly by following these instructions:

Link and execute external JavaScript file hosted on GitHub

I cannot figure out a way to have a master link to my file that updates as I commit edits. I can't use a commit hash, because that changes every time. I just want the URL to my javascript file to always reflect the latest commit and I cannot figure it out.

  • 1
    This has nothing to do with Git. You want to deploy your source code somewhere which Git is, frankly, unconcerned with. – Makoto Dec 13 '18 at 19:45
  • Actually, it does. I use jsdelivr to host the link directly. I want to be able to edit the code, commit, then have that code functioning on my other site live. I figured git was the best way to do this. – Patrick Hennessey Dec 13 '18 at 19:49
  • The question you link to suggests GitHub does not want you to do this. It's probably a significant additional load on their servers that they don't really want to see. – joanis Dec 13 '18 at 20:25
  • 1
    Ugh...... jsDelivr handles this perfectly fine. That's what it's for. Please read the post more carefully. – Patrick Hennessey Dec 13 '18 at 21:17

2 Answers2

1

jsDelivr will provide a CDN mirror of a Github repository. If you want to see your commits on jsDelivr it's necessary to get your commits onto Github. Because Git is decentralized git commit only commits to your local repository. You then need to git push your changes to Github. Then jsDelivr can sync with Github.

See Working With Remotes in the Git Book and Managing Remotes on Github for more information.

Schwern
  • 153,029
  • 25
  • 195
  • 336
0

Here's the solution I'm looking for: codepen.io.

Codepen lets you work on a JS file in-browser and in a sandbox, then use a direct link to that file that another site can use. This is perfect for me, because the site I need to embed the JS in isn't serving millions of visitors.