How to migrate multiple static websites from GitHub pages to Codeberg.

The official documentation can be found on, but I think it is confusing and incomplete if you want multiple pages and are using a custom domain name.

Getting your repository on Codeberg.

So, on the official documentation they say one has to create a repository named “pages” for the static website, but then what if one has multiple websites? It's also plain annoying to have such a name for a repository. Anyway, the following steps allow you to have multiple static pages on Codeberg without having to name them “pages”, ugh.

  1. Create an account on Codeberg:*. Then via the top right button click “+ New Repository”. Choose whatever repository name, and as “Default Branch” replace main with pages. Click “Create Repository”.
  2. Go to the directory on your local machine of which you want the content into your newly created Codeberg repository. For me that was “/home/…/project/”
  3. Assuming you still have the hidden .git folder, rename it to .git_BAK or whatever, or delete it.
  4. Open the terminal in that directory and run: git init It will probably show you the following message: “hint: Using 'master' as the name for the initial branch. This default branch name […] The just-created branch can be renamed via this command: git branch -m <name>”
  5. Run: git branch -m pages You see, the repository needn't be named pages, but the branch does. Which is great because now we can have multiple pages with distinct names. The official documentation makes it seem as if one is limited to one page.
  6. Run: git add . git commit -m "first commit" git remote add origin git push -u origin pages

– – – – – –

* This typo is intentional, apparently.

Domain configurations*.

Assuming you have a custom domain name, do the following. If you don't, then the official documentation probably suffices.

  1. Add the file “.domains” to your local repository with the following content, obviously adjusted to your own domain name, and push it to Codeberg:
  2. Go to your registrar website, and configure the “Advanced DNS” “host records” as follows: Type: A Record, Host: @, Value:, TTL: Automatic Type: AAAA Record, Host: @, Value: 2001:67c:1401:20f0::1, TTL: Automatic Type: CNAME Record, Host: www, Value:, TTL: Automatic Type: TXT Record, Host: @, Value:, TTL: Automatic

All is done. Now you might have to wait for a couple of hours until the domain configurations get updated. Also, don't forget to unpublish your page on GitHub.

Enjoy your day.

—Angelino Desmet; 15 April 2023.

– – – – – –

* Credits to Jan Wildeboer for helping with this.


Reply with [matrix].

← Return | ⌂ Home | € Support | ☑ RSS