How To Install git-crypt on CentOS 8

git-crypt is Transparent file encryption in git

Introduction

In this tutorial we learn how to install git-crypt on CentOS 8.

What is git-crypt

git-crypt enables transparent encryption and decryption of files in a git repository. Files which you choose to protect are encrypted when committed, and decrypted when checked out. git-crypt lets you freely share a repository containing a mix of public and private content. git-crypt gracefully degrades, so developers without the secret key can still clone and commit to a repository with encrypted files. This lets you store your secret material (such as keys or passwords) in the same repository as your code, without requiring you to lock down your entire repository.

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

Install git-crypt on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

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

sudo dnf -y install git-crypt

Install git-crypt on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

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

sudo yum -y install git-crypt

How To Uninstall git-crypt on CentOS 8

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

sudo dnf remove git-crypt

git-crypt Package Contents on CentOS 8

/usr/bin/git-crypt
/usr/lib/.build-id
/usr/lib/.build-id/c8
/usr/lib/.build-id/c8/df8b331bd6b04dcb99433773f83b0a26cff690
/usr/share/doc/git-crypt
/usr/share/doc/git-crypt/README
/usr/share/doc/git-crypt/README.md
/usr/share/licenses/git-crypt
/usr/share/licenses/git-crypt/COPYING
/usr/share/man/man1/git-crypt.1.gz

References

Summary

In this tutorial we learn how to install git-crypt on CentOS 8 using yum and dnf.