Skip to content

Setup pgp keys πŸ”‘ and sign commits with ease on Linux and Windows machines.

License

Notifications You must be signed in to change notification settings

phukon/gitkeykit.c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitKeyKit is a lightweight command-line tool that simplifies PGP key management for Git commit signing. It automates the process of creating, importing, and configuring GPG keys for Git commit verification.

GitKeyKit.c

A C implementation of GitKeyKit, originally created in TypeScript.

GitHub License


A C implementation of GitKeyKit, originally created in TypeScript. This port brings the same simplified PGP key management for Git commit signing to C, making it more portable and dependency-free.

GitKeyKit is a lightweight command-line tool that simplifies PGP key management for Git commit signing. It automates the process of creating, importing, and configuring GPG keys for Git commit verification.

Features ✨

  • Create PGP Keys: Automatically generate new PGP keys using your Git user information
  • Import Existing Keys: Import your existing PGP keys seamlessly
  • Git Configuration: Automatically configure Git to use your PGP key for commit signing
  • Cross-Platform: Works on both Windows and Unix-based systems
  • Easy Reset: Quick command to reset all GPG-related Git configurations

Prerequisites πŸ“‹

Before using GitKeyKit, ensure you have:

  • Git installed and configured with user.name and user.email
  • GPG (GnuPG) installed
    • Windows: Install Gpg4win
    • macOS: brew install gnupg
    • Linux: sudo apt-get install gnupg (Ubuntu/Debian) or equivalent

Installation πŸš€

Unix-like systems

cd gitkeykit
sudo make install

Usage πŸ“–

Setup GPG key for signing commits

gitkeykit

Import PGP key from file

gitkeykit import <key_path>

Reset Git and GPG configurations

gitkeykit --reset

Building from Source πŸ› οΈ

Compilation

make all

This will:

  • Compile the source files from src/, src/commands/, and src/utils/ directories
  • Link object files and create the executable in bin/ directory
  • Create necessary directories (build/ and bin/) if they don't exist
  • Generate the executable gitkeykit (or gitkeykit.exe on Windows)

Cleaning Up

make clean

This removes the build/ and bin/ directories along with all generated files.

Error Codes 🚨

Code Description
0 Success
1 GPG not found
2 Git not found
3 Invalid arguments
4 No secret keys found
5 Invalid input
6 Git configuration error
7 Key generation error
8 Key import error
9 Git configuration reset error
10 GPG configuration reset error
11 Home directory not found

About

Setup pgp keys πŸ”‘ and sign commits with ease on Linux and Windows machines.

Resources

License

Stars

Watchers

Forks

Packages

No packages published