Using git with Glitch

elvezpablo

Paul

Posted on November 11, 2020

Using git with Glitch

Glitch is a great place to host code samples for blogging and sketching out projects. My goal is to have a single source of truth for that code. Glitch has all the parts to do this with 1 gotcha.

Finding the Git url to clone the project.

The key here is each project is a git repository. Glitch pulls this code from the master branch on an interval to update the web project.

Either create a project or open an existing project in glitch.

Once open navigate to Tools -> Import and Export -> Your project's Git URL

Click the copy button.

Git URL in Glitch

Clone the repository on your computer and start committing!

Push to Master Workflow

After making some changes it's time to commit and push to master. Turns out Glitch doesn't allow this by default but it can be overridden via the Terminal inside Glitch with the following command.

git config receive.denyCurrentBranch updateInstead

Pushing will update and will change the output in a few minutes (non-scientific observation) but it doesn't sync up the IDE. For me this isn't a big deal as I would rather code locally.

To get the IDE in sync run the following command.

Resetting

Hope this helps someone!

💖 💪 🙅 🚩
elvezpablo
Paul

Posted on November 11, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related