GitRoot

Craft your forge, Build your project, Grow your community freely
  1<!--
  2SPDX-FileCopyrightText: 2025 Romain Maneschi <romain@gitroot.dev>
  3
  4SPDX-License-Identifier: CC-BY-SA-4.0
  5-->
  6
  7# From zero to hero
  8
  9You are intriged by GitRoot, but want to try it before deploye one instance? In this tutorial I propose to you to launch a local instance on your post. Linux users you are welcome, Mac one should work but never tested, **Windows user sorry but this will not work**.
 10
 11## Download and run
 12
 13Dowload: `wget -O gitroot https://gitroot.dev/releases/gitroot-last && chmod +x gitroot`. Warning: `gitroot-last` is for linux-amd64, others arch/cpu can be found in [versions page](../../CHANGELOG.md).
 14
 15Initialisation: `./gitroot --initConfig ./conf.yml`. You can review the file `conf.yml`, but for now default configuration should be good.
 16
 17Run: `./gitroot -config="./conf.yml" -data="./data"`.
 18
 19GitRoot will create a directory `data` where you launch it. All its data will be stocked here. By default GitRoot listen to port `4545` for ssh and `4546` for http.
 20
 21## Clone root repository
 22
 23In GitRoot all is stored in git. Even the repositories hosted on your instance. You need to clone the [root repository](../technicals/root_repository.md) to discover repositories or to add a new one (replace admin with the pseudo you want to use): `$PSEUDO=admin git clone ssh://$PSEUDO@127.0.0.1:4545/ root && cd root`.
 24
 25## Create your first repository
 26
 27In the [root repository](../technicals/root_repository.md) open `.gitroot/repositories.yml` and add:
 28
 29```diff
 30  root:
 31    kind: normal
 32    defaultbranch: main
 33+ repo1:
 34+  defaultbranch: main
 35```
 36
 37Commit and push, GitRoot will build your new repo: `git add . && git commit -m "add repo1 repository" && git push`.
 38
 39By default GitRoot use `main` has [defaultBranch](../technicals/default_branch.md) but you can put every name you like.
 40
 41You can clone and use your new repository, don't forget to init your local git config: `git clone ssh://127.0.0.1:4545/repo1 && cd repo1 && .gitroot/init.sh`
 42
 43> To delete a repository see [delete repository](../how-tos/delete_repository.md)
 44
 45## Install plugin
 46
 47GitRoot by itself don't do so much, but when you add some plugins it start to be a full forge.
 48
 49Before using a plugin in your repo, instance forge need to install it.
 50
 51In your [root repository](../technicals/root_repository.md) edit `.gitroot/plugins.yml` and add your first plugin:
 52
 53```yml
 54- url: "https://registry.com/path/to/plugin.wasm"
 55  checksum: "sha256:0c755bb2dc5cc037216b29ba1709875afee425ee429b6be97f0d5e137067acff"
 56```
 57
 58> Find plugin URLs, checksums and more on the [gitroot registry](../../plugins/index.md).
 59
 60Git commit and push: `git add . && git commit -m "add lot of plugins" && git push`
 61
 62GitRoot add all default configuration requiered for this plugin but not active it.
 63
 64After a `git pull` you will see that GitRoot had added a commit in your [root repository](../technicals/root_repository.md) and in all repositories of your forge.
 65
 66```diff
 67   url: "https://registry.com/path/to/plugin.wasm"
 68   checksum: "sha256:0c755bb2dc5cc037216b29ba1709875afee425ee429b6be97f0d5e137067acff"
 69+  name: plugin
 70+  active: false
 71+  run:
 72+  - path: issues/**/*.md
 73+    branch:
 74+    - "*"
 75+    when:
 76+    - add
 77+    - mod
 78+    write:
 79+      git:
 80+      - path: issues/**/*.md
 81+        can:
 82+        - mod
 83+      web: []
 84+    configuration:
 85+      metadata:
 86+      - default: autogenerated
 87+        mandatory: true
 88+        name: id
 89+        type: crc16
 90+      - default: 50.0
 91+        mandatory: true
 92+        name: priority
 93+        type: int
 94```
 95
 96> Want to delete a plugin? See [delete a plugin](../how-tos/delete_plugin.md)
 97
 98## Use a plugin
 99
100In any repository with plugin installed you can turn `active: false` to `active: true` in the `.gitroot/plugins.yml`. Don't forget to look/edit default configuration.
101
102```diff
103   url: "https://registry.com/path/to/plugin.wasm"
104   name: plugin
105-  active: false
106+  active: true
107  run:
108  - path: issues/**/*.md
109```
110
111For more details on plugins rights [read the documentation](../how-tos/plugin_rights.md).
112
113## Configure an executor
114
115If you want more than what the plugin ecosystem can provide, [configure an executor](../technicals/executors.md) and use all the tools you want.
116
117## Play with your forge
118
119Congratulation you have a full forge on your desktop! You can start developping something fun.
120
121You can [customize the web representation](../how-tos/customize_web.md) of your repository. Or you can use some [plugins](../index.md#plugins).
122
123But this is on your computer, you can't invite friends to play with you. For that you need to use an instance available on the web follow [deploy an instance](./deploy_instance.md) to do that.
124
125Or find a provider and [use it](./use_instance.md).
126
127But in any case enjoy your life.