DEVELOPER WORKFLOW & LIFECYCLE ENFORCEMENT

Automated Git Hooks & Pre-Push Anchoring

Seamless, zero-friction developer workflow integration. Automatically generates tamper-proof proof.json attestations before every push reaches remote origins.

๐Ÿช The Automation Imperative

Security and legal compliance systems fail when they depend on human memory. If developers must remember to run a manual verification command before every release or commit, sooner or later an unanchored commit reaches production.

GitProof solves this by integrating directly into Git's native hook lifecycle. With a single command:

TERMINALOne-Command Hook Installation
# Install automated pre-push and pre-commit hooks in current repository
gproof hook install

# Output:
โœ… Installed GitProof pre-push hook: .git/hooks/pre-push
โœ… Hook configured: automatically seals Merkle proof before git push

โš™๏ธ Hook Lifecycle & Execution Flow

When you run git push origin main, Git halts the push and delegates control to .git/hooks/pre-push:

  1. HEAD Detection: The hook determines the exact commit object ID being pushed.
  2. Working Tree Audit: Verifies working directory status. Uncommitted modifications trigger a prompt to ensure only clean code is certified.
  3. Merkle DAG Computation: Computes the SHA-256 Merkle root across all repository files.
  4. Seals `proof.json`: Writes the sealed cryptographic envelope directly into .gitproof/proof.json.
  5. Optional TSA Notarization: If configured, reaches DigiCert or Sectigo to attach an RFC 3161 atomic timestamp token.
  6. Push Continues: The hook exits 0, and Git transmits your authenticated commits to GitHub, GitLab, or your self-hosted remote.
๐Ÿ›ก๏ธ Non-Destructive Hook Management (`pkg/hooks`)

GitProof respects your existing repository setup. If you already have a pre-push script (e.g. for linting or test runners), GitProof non-destructively chains its execution rather than overwriting your custom script.

๐Ÿ”ฌ Inspecting and Removing Hooks

You can check the health of your installed hooks or remove them at any time:

TERMINALManaging Hooks
# Check hook status and verification flags
gproof hook status

# Remove GitProof hooks cleanly without touching other hooks
gproof hook remove

๐Ÿš€ CI/CD Pipeline Enforcement

Teams using GitHub Actions or GitLab CI can enforce that no pull request is merged unless its Merkle DAG proof and author signature are cryptographically valid:

YAMLGitHub Actions Enforcement (.github/workflows/verify.yml)
name: Verify Cryptographic Authorship
on: [push, pull_request]
jobs:
  gitproof-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install GitProof
        run: curl -fsSL https://gitproof.legendrail.com/install.sh | bash
      - name: Verify Repository Attestation
        run: gproof verify