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" 66crc32: null 67name: ladybug
68- url: "/plugins/ladybug/silo-0.0.1.wasm" 69crc32: null 70name: silo
71- url: "/plugins/ladybug/grafter-0.0.1.wasm" 72crc32: null 73name: grafter
74- url: "/plugins/ladybug/apex-0.0.1.wasm" 75crc32: null 76name: apex
77``` 78 79Git commit and push: `git add . && git commit -m "add lot of plugins" && git push` 80 81GitRoot add all default configuration requiered for this plugin but not active it.
82 83After a `git pull` you will see that GitRoot had added a commit in your root repository and in all repositories of your forge.
84 85```diff
86 url: "file:///plugins/ladybug/ladybug-0.0.1.wasm"
87 crc32: null
88 name: ladybug
89+ active: false
90+ run:
91+ - path: issues/**/*.md
92+ branch:
93+ - "*"
94+ when:
95+ - add
96+ - mod
97+ write:
98+ git:
99+ - path: issues/**/*.md
100+ can:
101+ - mod
102+ web: []
103+ configuration:
104+ metadata:
105+ - default: autogenerated
106+ mandatory: true
107+ name: id
108+ type: crc16
109+ - default: 50.0
110+ mandatory: true
111+ name: priority
112+ type: int
113```114115> Want to delete a plugin? See [delete a plugin](../how-tos/delete_plugin.md)
116117## Use a plugin
118119In 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.
120121```diff
122 url: "file:///plugins/ladybug/ladybug-0.0.1.wasm"
123 crc32: null
124 name: ladybug
125- active: false
126+ active: true
127 run:
128 - path: issues/**/*.md
129```130131For more details on plugins rights [read the documentation](../how-tos/plugin_rights.md).
132133## Play with your forge
134135Congratulation you have a full forge on your desktop! You can start developping something fun.
136137You can [customize the web representation](../how-tos/customize_web.md) of your repository. Or you can use some [plugins](../index.md#plugins).
138139But 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.
140141Or find a provider and [use it](./use_instance.md).
142143But in any case enjoy your life.