Przejdź do treści
Biblioteka skilli
Programowanie · Integracja z narzędziem

lfx-git-setup

/lfx-git-setup

Prowadzi autorów LFX przez konfigurację Gita do podpisu DCO i commitów podpisanych kluczem GPG: ustawienia ~/.gitconfig, dodanie klucza do GitHuba i naprawę commitów bez statusu Verified.

Repozytorium
lfx-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
21.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
4
Skrypty
0
Komentarze HTML
2
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 21.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • SKILL.md zawiera komentarze HTML (2). Nie widać ich w podglądzie Markdown, a model je czyta.

Co robi i kiedy

Prowadzi autorów LFX przez konfigurację Gita do podpisu DCO i commitów podpisanych kluczem GPG: ustawienia ~/.gitconfig, dodanie klucza do GitHuba i naprawę commitów bez statusu Verified.

Wyzwalacze z opisu

how do I sign my commits?t showing ason GitHub, when they
Oryginalny opis (EN)

Interactive setup guide for LFX contributors to configure Git for DCO signoff and GPG-signed commits. Use this skill whenever someone asks about setting up Git signing, DCO signoff, GPG keys for commits, configuring `~/.gitconfig` for signing, adding a GPG key to GitHub, or any variation of "how do I sign my commits?". Also trigger it when a user says their commits aren't showing as "Verified" on GitHub, when they're onboarding to an LFX project and need to meet contribution requirements, or when they ask about `git commit -s`, `--signoff`, `Signed-off-by`, or `commit.gpgSign`. This skill work

Jak działa

  1. Your First Step: Detect the User's Platform
  2. Overall Workflow (all platforms)
  3. DCO signoff
  4. Verifying Everything Works
  5. Troubleshooting Quick Reference
  6. Platform Reference Files
  7. Communication Style
Sekcje z nagłówków SKILL.md, w oryginale · 172 linii, 917 słów
Podgląd SKILL.md
---
name: lfx-git-setup
description: >
  Interactive setup guide for LFX contributors to configure Git for DCO signoff
  and GPG-signed commits. Use this skill whenever someone asks about setting up
  Git signing, DCO signoff, GPG keys for commits, configuring `~/.gitconfig` for
  signing, adding a GPG key to GitHub, or any variation of "how do I sign my
  commits?". Also trigger it when a user says their commits aren't showing as
  "Verified" on GitHub, when they're onboarding to an LFX project and need to
  meet contribution requirements, or when they ask about `git commit -s`,
  `--signoff`, `Signed-off-by`, or `commit.gpgSign`. This skill works for
  technical and non-technical users alike.
allowed-tools: Bash, Read, Glob, Grep, AskUserQuestion, WebFetch
---

<!-- Copyright The Linux Foundation and each contributor to LFX. -->
<!-- SPDX-License-Identifier: MIT -->

# LFX git Setup: DCO Signoff & GPG Signed Commits

This skill walks contributors through two essential git contribution
requirements used across linux foundation projects:

1. **DCO signoff** (`--signoff` / `-s`), adds a
  `Signed-off-by: your name <email>` line to every commit, certifying you wrote
  the code and have the right to contribute it under the project's license. This
  is a legal agreement, not just a formality.
2. **GPG signed commits** (`-S`), cryptographically signs each commit with your
   personal GPG key so GitHub can display a green "verified" badge, proving the
   commit genuinely came from you.

## Your First Step: Detect the User's Platform

Before doing anything else, check what operating system the user is on. The
steps are meaningfully different across platforms.

Ask the user (or check their context):

- **macos** → read `references/mac.md` for the full walkthrough
- **linux** (ubuntu, fedora, debian, arch, etc.) → read `references/linux.md`
- **windows** → read `references/windows.md`, note this is a supported but less
  common setup path; wsl2 (windows subsystem for linux) users should follow
  linux steps

If it's unclear which platform they're on, just ask: "what operating system are
you using, mac, linux, or windows?"

## Overall Workflow (all platforms)

The end goal is a `~/.gitconfig` that looks roughly like this:

```ini
[user]
    name = your full name
    email = your-github-verified-email@example.com
    signingkey = abc123def456  # your gpg key id

[commit]
    gpgSign = true             # auto-sign every commit with -S (GPG signing)

[tag]
    gpgSign = true             # auto-sign tags too
```

and a GPG key that:

- was generated with the same email address as your github account
- has its **public key** uploaded to GitHub (settings → ssh and gpg keys)

The DCO signoff (`-s`) is handled separately, see the **DCO signoff** section below.

### The Four Phases

- **phase 1, Prerequisites**: install gpg tools and verify git version.
- **phase 2, Generate GPG key**: create your personal signing key.
- **phase 3, Configure git**: wire the key into `~/.gitconfig`.
- **phase 4, Register with GitHub**: upload your public key so github can verify.

Each platform reference file covers all four phases with exact commands.

## DCO signoff

The DCO (`--signoff` or `-s`) flag is separate from gpg signing. it adds this line to your commit message:

```text
Signed-off-by: your name <your-email@example.com>
```

### Option A: Always Sign Off Manually (simplest)

```bash
git commit -s -S -m "your commit message"
```

Both flags together: `-s` for the DCO signoff, `-S` for GPG signature.

### Option B: git alias (recommended for convenience)

Add a `c` shortcut (or something you will remember) to `~/.gitconfig` so `git c
-m "..."` does both automatically:

An example would be:

```bash
git config --global alias.c 'commit -s -S'
```

Then use: `git c -m "your commit message"`

### Option C: Global Commit Hook (fully automatic)

This approach automatically appends `Signed-off-by` to every commit message,
even in GUI tools:

```bash
# create global hooks directory
mkdir -p ~/.git-hooks

# create the hook script
cat > ~/.git-hooks/prepare-commit-msg << 'eof'
#!/bin/sh
# Auto-add DCO Signed-off-by line
sob=$(git var git_author_ident | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
grep -Fqs "^$sob" "$1" || echo "$sob" >> "$1"
eof

# Make the git hook executable
chmod +x ~/.git-hooks/prepare-commit-msg

# Tell git to use this global hooks directory
git config --global core.hookspath ~/.git-hooks
```

> ⚠️ Note: the global hook applies to ALL repositories on your machine. If you
> work on non-lfx projects, you may prefer option A or B instead.

## Verifying Everything Works

Once setup is complete, do a test commit:

```bash
# in any git repository
git commit -s -S --allow-empty -m "test: verify DCO and gpg signing setup"
git log --show-signature -1
```

You should see:

- `gpg: good signature from "your name <email>"` in the output
- a `Signed-off-by:` line in the commit message

On GitHub, after pushing, the commit will show a green **verified** badge.

## Troubleshooting Quick Reference

| problem                                    | likely cause                    | fix                                               |
| ------------------------------------------ | ------------------------------- | ------------------------------------------------- |
| `error: gpg failed to sign the data`       | gpg agent issue                 | run `export GPG_TTY=$(tty)` and retry             |
| no verified badge on github                | key not uploaded or wrong email | check key email matches github verified email     |
| `secret key not available`                 | key id mismatch                 | re-run `git config --global user.signingkey <id>` |
| DCO check failing in ci                    | missing `signed-off-by`         | amend last commit: `git commit --amend -s`        |
| gpg prompts not appearing                  | missing pinentry                | see platform reference file for pinentry setup    |
| `gpg: signing failed: inappropriate ioctl` | tty not set                     | add `export GPG_TTY=$(tty)` to your shell profile |

## Platform Reference Files

- **macos**: `references/mac.md`
- **linux**: `references/linux.md`
- **windows / wsl2**: `references/windows.md`

Read the appropriate file based on the user's OS before walking them through
setup.

## Communication Style

This skill serves both technical and non-technical users. Adjust your tone:

- If the user is clearly a developer (mentions terminal, dotfiles, brew, apt,
  etc.), go straight to commands with brief explanations.
- If the user seems newer to the command line, explain what each command _does_
  before showing it, and reassure them that these are one-time setup steps.
- Never assume the user knows what GPG, DCO, or `~/.gitconfig` are, briefly
  define each on first mention.
- After each phase, confirm it worked before moving on. ask: "Did that complete
  without errors?" before proceeding.
Pliki w paczce (4)
  • SKILL.md 7 KB
  • references/linux.md 8 KB
  • references/mac.md 7 KB
  • references/windows.md 7 KB

Wersje

W bazie nie ma innych skilli o nazwie lfx-git-setup.

Migawka bazy z 28.10.2026 · wersja paczki 43b42a56f364 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95glab-gpg-key
    Dodaje, wypisuje i usuwa klucze GPG do podpisywania commitów oraz sprawdza podpisane commity w GitLab.
  • 100git-profile
    Zarządza tożsamością Git i profilami podpisywania GPG: wykrywa profile z GPG i konfiguracji git, przełącza lokalną tożsamość i sprawdza stan podpisywania.
  • 100sign-commits
    Ponownie podpisuje niepodpisane commity w gałęzi lub PR bez zmiany treści kodu, przepisując historię od pierwszego niepodpisanego commita.
  • 100commit
    Tworzy commity conventional z podpisem GPG, wykrywa pliki w staging i podpowiada podział zmian obejmujących kilka zagadnień.
  • 100commit-push-pr
    Zatwierdza zmiany, wypycha je i tworzy pull request przez gh CLI, z obsługą podpisu GPG i zakładaniem gałęzi, gdy praca idzie na main lub master.
  • 100commit-message
    Generuje komunikaty commitów w formacie conventional commits i pomaga przy tworzeniu commitów git.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.