How to update code on Glitch from GitHub

I have deployed a app for Glitch. The original code is hosted on GitHub. I would like to know how to update code on Glitch with GitHub’s update.

  1. Import code from GitHub user/repo
  2. update code on GitHub
  3. ? ← How to update code on Glitch

By the way, I have already tried import from GitHub again but it returned 500 error. Here is log below:

"error importing into project <project id>"

Thanks in advance.

2 Likes

You can just import your project from GtiHub again. It’ll overwrite all of the files in the Glitch project currently, leaving you with just the latest versions from the GitHub repo.

Thanks but I have already tried import from GitHub again but it returned 500 error. Here is log below:

"error importing into project <project id>"

Does it consistently do that when trying to import? If so, let us know if there are any other errors that you see in the browser dev console when the import fails. Thanks.

I got 500 error constantly.

console error

abort: function abort()
always: function always()
catch: function catch()
done: function add()
fail: function add()
getAllResponseHeaders: function getAllResponseHeaders()
getResponseHeader: function getResponseHeader()
overrideMimeType: function overrideMimeType()
pipe: function pipe()
progress: function add()
promise: function promise()
readyState: 4
responseJSON: "error importing into project <project-id>"
responseText: "\"error importing into project <project-id>\"\r\n"
setRequestHeader: function setRequestHeader()
state: function state()
status: 500
statusCode: function statusCode()
statusText: "Internal Server Error"
then: function then()
__proto__: Object { … }

Stacktrace:

send
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js:4:16836
ajax
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js:4:13668
ajax/<
application.coffee:333:8
Promise
https://glitch.com/edit/linters.min.js:1:262098
ajax
application.coffee:332:6
readGitHubRepo/<
application.coffee:1259:8
run
https://glitch.com/edit/linters.min.js:1:259965
notify/<
https://glitch.com/edit/linters.min.js:1:260223
flush
https://glitch.com/edit/linters.min.js:1:194099

I hope it help you solve problem. Thanks in advance

Hello Sam :slight_smile:

It would be really helpful if you could provide us with this information:

  1. what’s the Glitch project you’re trying to import into?
  2. what’s the GitHub project you’re trying to import from (if it is publicly accessible)?

Being able to try the import myself would really be helpful to discover a possible bug! :slight_smile:

@etamponi

  1. what’s the Glitch project you’re trying to import into?
  1. what’s the GitHub project you’re trying to import from (if it is publicly accessible)?

Thanks.

Hi Sam,

it looks like package.json specifies some commit-related hooks which fail when you try to import again from GitHub. We opened a bug report to fix this issue, but in the meantime, you can get up and running by removing these scripts from package.json: commit, precommit, commitmsg.

Moreover, it looks like some script is trying to modify programmatically the content of package.json: currently, we don’t support out-of-editor interaction with an editable file, so I would suggest you to use the terminal (Project menu -> Advanced Options -> Open Console) to edit package.json.

Sorry for the inconvenience, I’ll keep you posted when we figure out how to handle commit-related scripts in package.json!

1 Like

I appreciate that you identify the problem and suggest the solution but it seems not to be realistic. I will recreate project every time until this issue will be solved.

Happy Thanksgiving :turkey:

Hi Sam,

we just deployed a change that should fix your workflow :slight_smile: Let us know if you have any additional issue!

Happy Thanksgiving :turkey: to you too!

Hi Emanuele,

I appreciate your prompt response and it works well. :smile:

1 Like

By the way, I have created a node module which will help deploy GitHub repo to glitch.com continuously.

2 Likes