How To Install git-secrets on Fedora 36

In this tutorial we learn how to install git-secrets in Fedora 36. git-secrets is Prevents committing secrets and credentials into git repos

Introduction

In this tutorial we learn how to install git-secrets on Fedora 36.

What is git-secrets

git-secrets scans commits, commit messages, and –no-ff merges to prevent adding secrets into your git repositories. If a commit, commit message, or any commit in a –no-ff merge history matches one of your configured prohibited regular expression patterns, then the commit is rejected.

We can use yum or dnf to install git-secrets on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install git-secrets.

Install git-secrets on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install git-secrets using dnf by running the following command:

sudo dnf -y install git-secrets

Install git-secrets on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install git-secrets using yum by running the following command:

sudo yum -y install git-secrets

How To Uninstall git-secrets on Fedora 36

To uninstall only the git-secrets package we can use the following command:

sudo dnf remove git-secrets

git-secrets Package Contents on Fedora 36

/usr/bin/git-secrets
/usr/share/doc/git-secrets
/usr/share/doc/git-secrets/CHANGELOG.md
/usr/share/licenses/git-secrets
/usr/share/licenses/git-secrets/LICENSE.txt
/usr/share/man/man1/git-secrets.1.gz

References

Summary

In this tutorial we learn how to install git-secrets on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).