Using Git to edit projects directly from VScode... somehow?

I want to ask if it’d be possible to edit projects directly from somewhere else with git and see results immediately. I’ve never used git, but I saw somebody talking about how this could be possible. I do like the glitch IDE and all, but sometimes I need stuff in VScode like prettier and other tools. I don’t know where to start when researching about this so I’m asking here. Is it possible, and if so how? Maybe could you link some resources where I can learn how?

1 Like

a more seamless integration of the glitch editor and local desktop tools is something we would like to enable in the future.

Right now though you can kind of get this working by

  1. export your project to github,
  2. clone the project repo locally and edit it in VScode
  3. push to github, make sure master is updated with your new code
  4. from glitch, import the repo again. This will replace the glitch version with the code from the github version
  5. you can repeat this flow as needed

hope that helps

1 Like

The solution you present is straight forward and very usable, thanks!

Can’t help but say that it would be very pleasant to develop with this flow.

Something such as https://www.netlifycms.org, with which commits made through the web UI (and saved through git); commits are attributed to the git(hub/lab/bucket) user, as they would be from the command line.

One more reason to add in favor of Git(hub/lab) integration, are the triggers offered by CI pipeline tools, offered when hosting a repo.

cheers!

1 Like

This may be offtopic, but how would I clone the project repo locally and push to github?

For cloning the Glitch repo locally, try

git clone https://api.glitch.com/your-project/git

as in the URL your-project.glitch.me

For pushing to Github with the Command Line Interface (CLI)

Change the current working directory to the newly downloaded git repository folder:
cd your-project

Then git remote add github git@github.com/your-user/your-project.git to add a new git remote (a place where your repository is hosted, Glitch and now Github).
Replace github by the name you would like the remote to have, and your-user + your-project by the correct values. See for more details https://help.github.com/articles/adding-a-remote/
Of course for this step you will have had to first create a new git repository on your Github account.

Following this use your normal git workflow, with comits, push/pull, branches …

Does this help?

2 Likes