# Tooling Guides

# Version Control Guides

# Git Client Guide

[![git-scm.com](https://img.shields.io/badge/git--scm.com-0288D1?style=flat)](https://git-scm.com/)
[![documentation](https://img.shields.io/badge/documentation-077b70?style=flat)](https://git-scm.com/book/en/v2)
[![git/git](https://img.shields.io/badge/git/git-555555?style=flat&logo=github&logoColor=white)](https://github.com/git/git)

Installation
-------------

```shell distribution="Debian"
sudo apt install git git-lfs
```

Initial Client Setup
---------------------

[![documentation](https://img.shields.io/badge/documentation-Git_Configuration-077b70?style=flat)](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration)

```shell
git config --global user.name "[NAME]"
git config --global user.email "[EMAIL]"
git config --global init.defaultBranch "main"
git config --global core.excludesFile "~/.gitignore"
```

```shell
git lfs install
```

```shell
tee "$HOME/.gitignore" >/dev/null <<'EOF'
.idea
.vscode
EOF
```

# Git Repository Guide

[![git-scm.com](https://img.shields.io/badge/git--scm.com-0288D1?style=flat)](https://git-scm.com/)
[![documentation](https://img.shields.io/badge/documentation-077b70?style=flat)](https://git-scm.com/book/en/v2)

Exclude Files from Version Tracking
------------------------------------

[![documentation](https://img.shields.io/badge/documentation-Recording_Changes_to_the_Repository-077b70?style=flat)](https://git-scm.com/book/ms/v2/Git-Basics-Recording-Changes-to-the-Repository)

```gitignore filename=".gitignore"
# SPDX-License-Identifier: 0BSD
# SPDX-FileCopyrightText: none

*.backup
*.bak
*.key
*.local
*.log
*.pem
*.sqlite*
*.swp
*.tmp
*~
```

Keep Git Hooks in Project
--------------------------

[![documentation](https://img.shields.io/badge/documentation-Git_Hooks-077b70?style=flat)](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)

#### Git Hooks Initialization Recipe

##### Just

```just filename=".just/githooks.just"
# SPDX-License-Identifier: 0BSD
# SPDX-FileCopyrightText: none
#
# Manage the Git hooks living in this repository.

# Run the recipes at the project root, not at the `.just` directory.
set working-directory := '..'

GITHOOKS := ".githooks"

# Configure Git to use the local `.githooks` directory.
init:
    git config --local core.hooksPath "{{ GITHOOKS }}"
```

```just
# Manage the Git hooks living in this repository.
[group('githooks')]
mod githooks '.just/githooks.just'
```

##### Make

```make filename=".githooks/githooks.mk"
# SPDX-License-Identifier: 0BSD
# SPDX-FileCopyrightText: none
#
# Manage the Git hooks living in this repository.

GITHOOKS := .githooks

.PHONY: githooks
githooks:
	git config --local core.hooksPath "$(GITHOOKS)"
```

```make
include .githooks/githooks.mk
```

# Commitizen Guide

[![commitizen-tools.github.io](https://img.shields.io/badge/commitizen--tools.github.io-0288D1?style=flat)](https://commitizen-tools.github.io/commitizen/)
[![documentation](https://img.shields.io/badge/documentation-077b70?style=flat)](https://commitizen-tools.github.io/commitizen/tutorials/writing_commits/)
[![commitizen-tools/commitizen](https://img.shields.io/badge/commitizen--tools/commitizen-555555?style=flat&logo=github&logoColor=white)](https://github.com/commitizen-tools/commitizen)

Installation
-------------

```shell
pipx install commitizen
```

Auto-Check Commits via Git Hooks
---------------------------------

[![documentation](https://img.shields.io/badge/documentation-Manual_Git_Hook_Installation-077b70?style=flat)](https://commitizen-tools.github.io/commitizen/tutorials/auto_check/#method-2-manual-git-hook-installation)

```shell filename=".githooks/commit-msg"
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2026 Tomáš Havlas <tomas@havlas.me>
#
# Enforce the Conventional Commits format with Commitizen.

set -euo pipefail

if ! command -v cz >/dev/null 2>&1; then
  echo "no cz, try running 'pipx install commitizen'"
  exit 127
fi

git cz check --allow-abort --commit-msg-file "$1"
```

# EditorConfig Guide

[![editorconfig.org](https://img.shields.io/badge/editorconfig.org-0288D1?style=flat)](https://editorconfig.org/)
[![editorconfig/editorconfig](https://img.shields.io/badge/editorconfig/editorconfig-555555?style=flat&logo=github&logoColor=white)](https://github.com/editorconfig/editorconfig)

General Code Style
-------------------

```ini filename=".editorconfig"
# SPDX-License-Identifier: 0BSD
# SPDX-FileCopyrightText: none

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true

[*.md]
# Trailing whitespace is significant in Markdown.
trim_trailing_whitespace = false

[{*.toml,*.ini}]
indent_size = 4
indent_style = space

[{*.yml,*.yaml,*.json}]
indent_size = 2
indent_style = space

[{Makefile,*.mk}]
# Make requires tabs to indent recipes.
indent_size = 4
indent_style = tab
```

# Justfile Guide

[![just.systems](https://img.shields.io/badge/just.systems-0288D1?style=flat)](https://just.systems/)
[![documentation](https://img.shields.io/badge/documentation-077b70?style=flat)](https://just.systems/man/en/)
[![casey/just](https://img.shields.io/badge/casey/just-555555?style=flat&logo=github&logoColor=white)](https://github.com/casey/just)

Installation
-------------

```shell
curl --proto '=https' --tlsv1.2 -sSf "https://just.systems/install.sh" | sudo bash -s -- --to "/usr/local/bin"
```

Usage
------

#### Show Help Recipe

```just filename=".just/help.just"
# SPDX-License-Identifier: 0BSD
# SPDX-FileCopyrightText: none
#
# Default the `just` invocation to an overview of the available recipes.

# Show this help message.
[default]
help:
    @just --unsorted --list --list-submodules
```

```just
import '.just/help.just'
```