Your first site

Put it in git

Keep your site on a git platform, so every change is saved with its history, and the editor and your publishing pipeline can reach it.

So far your site is a folder on your computer. Putting it in a git repository on a git platform means:

  • every change is kept, and any of them can be undone;
  • the editor can open it, and other people can work on it;
  • your platform can publish it automatically (see Publishing).

What you need

  • git installed, with your name and email set.
  • An account on a git platform: GitHub, GitLab, Gitea, Forgejo, Codeberg or Bitbucket. The steps are much the same on each; GitHub is shown here.

1. Make an empty repository on the platform

On GitHub: choose + at the top right, then New repository.

  • Repository name: something like mysite.
  • Private or Public: either works. Private keeps your drafts to yourself.
  • Leave Add a README, .gitignore and license unticked. Your site already has what it needs, and an empty repository is easiest to push to.

Choose Create repository. GitHub shows the repository's address, like https://github.com/you/mysite.git. Copy it.

On Gitea, Forgejo or Codeberg, choose + → New Repository. On GitLab, New project → Create blank project (untick "Initialize repository with a README"). On Bitbucket, Create → Repository.

2. Save your site's first version

In the terminal, in your site's folder:

git init -b main
git add .
git commit -m "Start the site from the HotDog template"
  • git init -b main makes the folder a repository, with main as its branch.
  • git add . picks up every file (the template's .gitignore already leaves out public/).
  • git commit saves them as the first version, with a message saying what it is.

3. Send it to the platform

Use the address you copied in step 1:

git remote add origin https://github.com/you/mysite.git
git push -u origin main

The first push asks you to sign in. On GitHub, your password won't work here: use the GitHub CLI (gh auth login), a credential manager (Git for Windows includes one), or an SSH key. Other platforms accept an access token in place of your password.

Reload the repository's page on the platform: your site's files are there.

From now on

Each time you've changed something and want to keep it:

git add .
git commit -m "Say what changed"
git push

Or use the editor, which does all of this when you press Save, Submit for review and Publish.