What should I .gitignore when commiting to the Git repository on Glitch?

I used https://token@api.glitch.com/git/projectid to open my project’s Git repo in VS Code by following this guide. One problem I noticed was that .env and .data/ didn’t copy over. So I manually copied them into my local folder.

Now that I’m ready to commit the files back to the remote, what do I need to .gitignore? Definitely node_modules/ - that didn’t copy over either, but I don’t need to send it back on Git. Should I gitignore the .env file? What about the .data folder? I don’t want to lose any data while transferring it between locations, but neither do I want some sort of project security risk (seeing environment variables in repo, private data, etc.)

In short: What should I .gitignore when sending files back and forth between the Glitch git repo and my local git repo?

Doing a little investigation I found out that the files that should be gitignored are the ones that Glitch is already ignoring. You can find this list when you run git status --ignored in the terminal. For me it was these files that I had to ignore:

.bash_history
.config/
.data/
.env
.glitchdotcom.json
.node-gyp
node_modules

It might be different for others if you have files that you manually gitignore. Since I only recreated .data/, .env, and node_modules, I included only those three in my local .gitignore which will also be committed along with my other changes.

These are just my findings. If anyone else could investigate further to verify/disprove this guess, that would be great.

Hi @lraj22 - I’ve passed this info on to our engineering team so I can get verification or correction on this. I’ll post an update here when I get one!

Okay I’m back - if you look in /etc/gitignore-global (you can just run cat /etc/gitignore-global in the terminal) you’ll see the full list of what Glitch apps ignore.

@jenn Got it - to see ALL of the files that Glitch ignores, run cat /etc/gitignore-global, and to see the files which are currently being ignored, run git status --ignored. And then gitignore all of those files in your local .gitignore too (or just the ones you recreated).

Thanks!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.