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/gitroot-0.1.0 && chmod +x gitroot`.
 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 to discover repositories or to add a new one: `git clone ssh://$PSEUDO@127.0.0.1:4545/ -o root && cd root`.
 24
 25Configure your local git client by running `.gitroot/init.sh`, then all is ok you can start adding code, repository or user.
 26
 27> Don't want to run unknown sh? See [manually init client](../how-tos/manual_init_client.md).
 28
 29## Create your first repository
 30
 31In the `root` repository open `.gitroot/repositories.yml` and add:
 32
 33```diff
 34  root:
 35    kind: normal
 36    defaultbranch: main
 37+ repo1:
 38+  defaultbranch: main
 39```
 40
 41Commit and push, GitRoot will build your new repo: `git add . && git commit -m "add repo1 repository" && git push`.
 42
 43By default GitRoot use `main` has [defaultBranch](../technicals/default_branch.md) but you can put every name you like.
 44
 45You 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`
 46
 47> To delete a repository see [delete repository](../how-tos/delete_repository.md)
 48
 49## Install plugin
 50
 51GitRoot by itself don't do so much, but when you add some plugins it start to be a full forge.
 52
 53Before using a plugin in your repo, instance forge need to install it.
 54
 55Download some plugins:
 56
 57- `wget https://gitroot.dev/ladybug-0.0.1.wasm`
 58- `wget https://gitroot.dev/silo-0.0.1.wasm`
 59- `wget https://gitroot.dev/grafter-0.0.1.wasm`
 60- `wget https://gitroot.dev/apex-0.0.1.wasm`
 61
 62In your root repository edit `.gitroot/plugins.yml` and add your first plugin:
 63
 64```yml
 65- url: "/plugins/ladybug/ladybug-0.0.1.wasm"
 66- url: "/plugins/ladybug/silo-0.0.1.wasm"
 67- url: "/plugins/ladybug/grafter-0.0.1.wasm"
 68- url: "/plugins/ladybug/apex-0.0.1.wasm"
 69```
 70
 71Git commit and push: `git add . && git commit -m "add lot of plugins" && git push`
 72
 73GitRoot add all default configuration requiered for this plugin but not active it.
 74
 75After a `git pull` you will see that GitRoot had added a commit in your root repository and in all repositories of your forge.
 76
 77```diff
 78   url: "file:///plugins/ladybug/ladybug-0.0.1.wasm"
 79   name: ladybug
 80+  active: false
 81+  run:
 82+  - path: issues/**/*.md
 83+    branch:
 84+    - "*"
 85+    when:
 86+    - add
 87+    - mod
 88+    write:
 89+      git:
 90+      - path: issues/**/*.md
 91+        can:
 92+        - mod
 93+      web: []
 94+    configuration:
 95+      metadata:
 96+      - default: autogenerated
 97+        mandatory: true
 98+        name: id
 99+        type: crc16
100+      - default: 50.0
101+        mandatory: true
102+        name: priority
103+        type: int
104```
105
106> Want to delete a plugin? See [delete a plugin](../how-tos/delete_plugin.md)
107
108## Use a plugin
109
110In 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.
111
112```diff
113   url: "file:///plugins/ladybug/ladybug-0.0.1.wasm"
114   name: ladybug
115-  active: false
116+  active: true
117  run:
118  - path: issues/**/*.md
119```
120
121For more details on plugins rights [read the documentation](../how-tos/plugin_rights.md).
122
123## Play with your forge
124
125Congratulation you have a full forge on your desktop! You can start developping something fun.
126
127You can [customize the web representation](../how-tos/customize_web.md) of your repository. Or you can use some [plugins](../index.md#plugins).
128
129But 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.
130
131Or find a provider and [use it](./use_instance.md).
132
133But in any case enjoy your life.