Skip to content
Snippets Groups Projects

Redo git commit with gpg

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Frank Sauerburger
    Edited
    redo_with_gpg 279 B
    #!/bin/bash
    
    set -e
    
    gitpath=$(git rev-parse --git-dir)
    basepath=$(git rev-parse --show-toplevel)
    cp "${gitpath}/COMMIT_EDITMSG" "${basepath}/COMMIT_EDITMSG"
    gpg --sign  "${basepath}/COMMIT_EDITMSG"
    git commit -S
    
    rm "${basepath}/COMMIT_EDITMSG" "${basepath}/COMMIT_EDITMSG.gpg"
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment