---
name: "git-secret-init"
section: "1"
platform: "linux"
package: "git-secret"
version: "0.5.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/git-secret-init"
---

# git-secret-init(1)

initializes git-secret repository.

## NAME

**git-secret-init** - initializes git-secret repository.

## SYNOPSIS

```
git secret init
```

## DESCRIPTION

**git-secret-init** - initializes a **git-secret** repo by setting up a **.gitsecret** directory.

**git-secret-init** should be run inside a **git** repo, to create the **.gitsecret** directory and initialize the repo for git-secret. Until a repository is initialized with **git secret init**, all other **git-secret** commands are unavailable.

If a **.gitsecret** directory already exists, **git-secret-init** exits without making any changes. Otherwise,

- •

  **.gitignore** is modified to ignore **git-secret**´s **random\_seed\_file**, and to not ignore **.secret** files,

- •

  a .gitsecret directory is created with the sub-directories /keys and /paths,

- •

  The **.gitsecret/keys** subdirectory permission is set to 700 to make gnupg happy.

-

  See [git-secret(7)](/git-secret/7.md) *https://git-secret.io/git-secret* for information about renaming the .gitsecret folder with the **SECRETS\_DIR** environment variable, and changing the extension **git-secret** uses for secret files with the **SECRETS\_EXTENSION** environment variable.

## OPTIONS

```
-h  - shows this help.
```

## MANUAL

Run **man git-secret-init** to see this document.

## SEE ALSO

[git-secret-usage(1)](/git-secret-usage/1.md) *https://git-secret.io/git-secret-usage*, [git-secret-tell(1)](/git-secret-tell/1.md) *https://git-secret.io/git-secret-tell*
