You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
Home > Importing & Exporting > How do I push code that I created locally to my project on Glitch?
How do I push code that I created locally to my project on Glitch?

If you are familiar with git commands, you can use the process described below to push code that you have created outside of Glitch into your project.

 

Here’s how:

 

Step One: Get your git URL

First, you will need to get the git URL for your project.

 

To do this:

  1. Open the Project Editor.
  2. Click on 'Tools', and then click the 'Import and Export' button.
  3. Now you should see Your project’s Git URL. You can click the 'copy’ button to save this URL to your clipboard.

 

 

Next, run this command in the Glitch project terminal to ensure you can push to the active branch directly. You only need to do this once and your project will remember this setting for all future changes:

 

git config receive.denyCurrentBranch updateInstead

 

 

Step Two: Clone your project locally

You can use your computer’s command line tools to access your project from outside of Glitch. Here is the command - be sure to paste in your git URL:

 

git clone <paste your git URL here>

 

Step Three: Make your changes and push to Glitch

 

<make code changes and commit>

git push

 

Step Four: View your changes in the Project Editor

Go to your project on Glitch. If the editor was already open when you pushed to your project, then in order to see them, you will need to run refresh in the project terminal, or reload the editor.

 

Boom! The code you created locally is now in your Glitch project, and you’ll be able to see your commit(s) in the Rewind view.

Got more questions?  Check out our Community Forum

Open 24/7, the forum is where Glitch makers help each other and show off all the rad apps that they have created.  It's the friendliest community of coders on the Web!


 
Feedback
2 out of 2 found this helpful

scroll to top icon