A major advantage of migrating to a static site architecture (Jamstack) is that your website’s content and code live together in version control, rather than a vulnerable database. This makes everything perfectly traceable, easily restorable, and highly secure.
The industry standard for hosting this code is Git. In this tutorial, we will show you how to securely store your new ZeroPress site in a Private GitHub Repository.
Why GitHub?
GitHub is a developer platform that allows developers to create, store, manage and share their code. By using GitHub for your website, you gain:
- Version History: Every change, every typo fix, every new article is tracked. You can revert to a previous version in seconds.
- Off-site Backup: Your entire site is backed up securely in the cloud.
- Automated Deployments: Services like Cloudflare Pages use GitHub to automatically rebuild your site the moment you push a change.
Step 1: Create a GitHub Account
If you don’t have one, head over to GitHub.com and sign up for a free account.
Step 2: Create a New Repository
- Once logged in, click the + icon in the top right corner and select New repository.
- Repository name: Give it a clear name, like
my-zeropress-blog. - Visibility: This is crucial. Select Private. You don’t want the raw source code of your site (which might contain drafts or configuration files) to be public. The generated HTML will be public later, but the source should remain private.
- Leave the initialization options unchecked (no README, no .gitignore) for now.
- Click Create repository.
Step 3: Push Your ZeroPress Code
Now you need to upload the unzipped folder you downloaded from the ZeroPress Dashboard to this new repository.
You can do this in two ways:
Option A: Using the Command Line (Recommended)
If you have Git installed on your computer, open your terminal, navigate to your unzipped ZeroPress folder, and run these commands (replace the URL with your repository’s URL):
git init
git add .
git commit -m "Initial ZeroPress Migration"
git branch -M main
git remote add origin https://github.com/yourusername/my-zeropress-blog.git
git push -u origin main
Option B: Using GitHub Desktop
If you prefer a visual interface, download GitHub Desktop.
- Go to File > Add Local Repository and select your ZeroPress folder.
- It will prompt you to create a repository. Follow the steps, ensuring it’s marked as Private.
- Click “Publish repository” to push it to the cloud.
You’re Secure!
Your website is now safely backed up and version-controlled. Now the exciting part: making it live on the internet for free! Check out our guide on Deploying to Cloudflare Pages.