# git

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> git itself, the install companion to the git tool configuration.


Installs `git` from the distribution's package manager.

```yaml
devtools:
  - name: git
```

The `version` field is not used by this recipe.

This is a thin recipe; `packages: [git]` does the same install. It exists so that a
config layer can carry both halves of "a workstation with a working git" in one place:

```yaml
devtools:
  - name: git                 # install it
toolconfigs:
  - name: git                 # give it an identity
    config:
      userName: Ada Lovelace
      userEmail: ada@example.com
```

## Updates

Git comes from the distribution's packages, so it moves with the
[operating system updates](https://docs-stg.ringleader.dev/reference/tools/devtools/#operating-system-updates) the workstation applies.

## Example

A portable identity layer: attach it by label to any workstation you own, and every one of
them gets your git author identity with no `git config --global` inside the VM.

```yaml
apiVersion: workstations.ringleader.dev/v1
kind: WorkstationConfig
metadata:
  name: my-git-identity
  namespace: local
spec:
  selector:
    matchLabels:
      owner: ada
  priority: 200
  devtools:
    - name: git
  toolconfigs:
    - id: git
      name: git
      config:
        userName: Ada Lovelace
        userEmail: ada@example.com
        settings:
          init.defaultBranch: main
          pull.rebase: "true"
```

See the [`git` toolconfig](https://docs-stg.ringleader.dev/reference/tools/tool-configuration/git/) for the full
configuration surface.

## Notes

- Safe to re-run: a workstation that already has `git` (from `packages`, from the base
  image, or from an earlier setup run) is skipped.
- Access to private repositories is set up outside the devtool. Use HTTPS git with
  credential injection, as [Injected credentials](https://docs-stg.ringleader.dev/security/credentials/injected-credentials/)
  shows. It adds the credential outside the workstation. A `sources[].git.credentialRef` hands its token or deploy
  key to the workstation for the clone it makes. An
  [SSHKey](https://docs-stg.ringleader.dev/reference/resources/sshkey/) lets every program in the workstation sign with
  your local key while it is forwarded.
- Works on Debian, Ubuntu, and Alpine.

