FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
saolsen
saolsengit_sync
Public
Like
git_sync
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Sync vals to a git repo

CleanShot 2024-01-04 at 14.47.41@2x.png

This will not run on val town! You need to run it locally with deno.

  • Install Deno: https://docs.deno.com/runtime/manual/getting_started/installation
  • Set your val.town api key as an environment variable. https://www.val.town/settings/api
    • export valtown="abcdefgh-ijkl-mnop-qrst-uvwxyz123456"
  • Create a git repo to sync to.
    • mkdir ./valtown && pushd ./valtown && git init && popd
  • Copy down this script and run it, passing the path to your git directory.
    • deno run -A ./git_sync.ts ./valtown

There is currently no incremental syncing or recovering. You can only use this script against a fresh git repo. If you want to sync to an existing repo, you should create a new repo, run the script and then force push to your existing repo.

This will sync all your vals, including private ones so be careful where you push your git repo if you want those to remain private.

Migrated from folder: tools/git_sync

Code
README.mdmain.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.