DEV Community

Cover image for Using git with Glitch
Paul
Paul

Posted on

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!

Top comments (0)