How to store your site in Git?

Undraw Stepping Up

Bonus: How to store your site in Git?

About

This page will show you how to store your site as combo site in a remote Git repository.

Steps

Create a remote Git Repository

We will be using GitHub as example, but you can use any Git Repository Provider such as Gogs, GitLab or Gitea.

For GitHub, follow this article to create your new repository.

Create a local Git Repository

* Go to the root of your DokuWiki installation.

  • If you choose the docker installation, it's the directory that was used with the docker command
  • Otherwise it's the directory where you found the doku.php file
cd /tmp/site-combo-starter

* Initialize a Git repository

# Init (ie create ) a local repo
git init
  • Rename the master branch to main
git branch -M main

The secret sauce, add .gitignore

Now, the secret sauce

Because we don't want to back up all files into Git, we can use the gitignore mechanism to ignore all code file and not our pages and assets.

If you didn't choose the docker installation method, add the .gitignore file manually or with wget and bash

wget https://raw.githubusercontent.com/combostrap/site-starter/refs/heads/main/.gitignore > .gitgnore

Add the Git remote

  • Add the URL of your repository as origin
git remote add origin https://github.com/ComboStrap/site-starter.git

Check the untracked files

git status
On branch main

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .gitattributes
        .gitignore
        README.md
        conf/
        data/
        docs/
        lib/
        robots.txt

nothing added to commit but untracked files present (use "git add" to track)

Add your site files

Add them all

git add .

Create your first commit

  • Create a commit
git commit -m "First commit"

Push them to your remote repository

  • Push
git push -u origin main
# enter your credentials
# or use SSH Keys (https://docs.github.com/en/authentication/connecting-to-github-with-ssh)
Enumerating objects: 45, done.
Counting objects: 100% (45/45), done.
Delta compression using up to 16 threads
Compressing objects: 100% (36/36), done.
Writing objects: 100% (45/45), 50.71 KiB | 10.14 MiB/s, done.
Total 45 (delta 1), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (1/1), done.
To github.com:ComboStrap/site-starter.git
 * [new branch]      main -> main
branch 'main' set up to track 'origin/main'.

Next

If you write locally, you can now develop, change your wiki and push your change to your Git Repository.

Then you can:

For more tips and tops, you can also subscribe to the newsletter.




Showcase yourself and your brand

Get free news, tips, and tricks
to create a remarkable experience for your readers.




Related HowTo's
Undraw Stepping Up
How to get started with ComboWiki ?

This page helps you to get started with ComboWiki
Undraw Stepping Up
Top menubar

The theme system supports the creation of a slot page called header slot in order to create a menu bar at the top location of the page. * Create a page called :slot_header (at the root directory...




Task Runner