git: error: gpg failed to sign the data

If you try to sign commit with git, and you get the following error:

====================== 

error: gpg failed to sign the data
fatal: failed to write commit object
======================
 
  1. Check your ~/.gitconfig file, which must include at least the following sections:
    [user]
    name = Your Name Here
    email = your@email.com
    #key ID coming from gpg --list-keys
    signingkey = AABBCCDDFF112233445566
    [commit]
    gpgsign = 1
    [gpg]
    #could be gpg or gpg2 or full path to them
    program = gpg2
     
  2. If above is fine, check if your GPG is working correctly on the following link:
 gpg or gpg2 gpg: signing failed: Inappropriate ioctl for device 

gpg or gpg2 gpg: signing failed: Inappropriate ioctl for device

 If you ever get the following error, while trying to sign with gpg:

gpg: signing failed: Inappropriate ioctl for device

try the following steps

Test if gpg is actually working:

======================

echo "test" | gpg2 --clearsign
======================
If you get error like this: 
 
====================== 
[root@localhost]# echo "test" | gpg2 --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test
gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device 
======================
 

then try the following:

======================
[root@localhost]# export GPG_TTY=$(tty)
======================
 
If this fixes the problem, add it to your .bashrc or .bash_profile file 



growpart: no tools available to resize disk with 'gpt'

If you get the following message while trying to resize GPT partition:


[root@localhost ~]# growpart /dev/sda 1
no tools available to resize disk with 'gpt'
FAILED: failed to get a resizer for id ''
 
This is because you are missing the package: gdisk
 
Install it, and the problem is solved:
 
[root@localhost ~]# yum -y install gdisk