set a remote on a local git repository to point to your Glitch project’s repo, including the project’s git token. Both url and token available in the Advanced Options menu

get the code you want to push on a different branch than master because git won’t allow you to push to master

push your new branch

in your project’s console, merge the new branch into master

There are some variations depending on whether you’re starting from a local copy of an exported project or are starting from scratch.

I plan on documenting this process in the help docs better but haven’t gotten to it yet.

There are no api methods that will allow you to upload code to a project, and no current plans to support that, although we may try to make it easier to upload projects in the UI some time down the road.

Can you give me the step-by-step detailed rundown of what you’re doing and what the actual response is? Also if you could share your project name so I can take a look that would be great (email to support@glitch.com is fine)

in your local repo add your project’s repo as a remote: git remote add origin https://{{put your git token here}}:@{{put your git url here}}. That’s using basic authentication with an empty password and your project’s repo url, so an example with a spoofed token might look like https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:@api.glitch.com/anonymous-anaconda/git. This allows you to authenticate to your project’s repo so you can push.

As I noted above by default your project has the master branch checked out, so assuming you haven’t changed that you won’t be able to push to master - git will report an error if you do. So you need to move the code you want to push to a new branch before you can push it. In your local repo: git checkout -b my-new-branch

Now you have something you can push. Assuming you’ve never pushed this branch before in your local repo: git push --set-upstream origin my-new-branch

To get your new code live, in your project’s console: git merge my-new-branch. If you want to verify what you’re going to merge you can use git diff ..my-new-branch first.

refresh in your project’s console to update the editor with the new changes.

Once you’ve got things set up you can just repeat steps 4-6 for all your local changes, except for step 4 you’ll want git push origin my-new-branch (you’ve already set up that branch to track the remote’s branch, so you don’t need --set-upstream. If you’re making changes in both places it’s a little more complicated because you’ll need to pull those changes down to get them locally: