git-crypt

Get from : github.

Get from brew:

$ brew install git-crypt

Get from git repository

1. install make

  $ yum -y install gcc automake autoconf libtool make

2. install g++

  $ yum install gcc gcc-c++

3. install openssl-devel (if get error need install! 'crypto-openssl.cpp:34:25: 致命错误:openssl/aes.h:没有那个文件或目录')

  $ yum install openssl-devel

3. get git-crypt

  a. Download and extract
  $ wget https://www.agwa.name/projects/git-crypt/downloads/git-crypt-0.5.0.tar.gz
  $ tar -zxvf git-crypt-0.5.0.tar.gz
  $ cd git-crypt-0.5.0
  $ make
  $ make install

  b. get from github
  $ git clone https://www.agwa.name/git/git-crypt.git
  $ cd git-crypt
  $ make
  $ make install

Init repo:

$ git-crypt init

Edit .gitattributes file:

$ touch .gitattributes
$ cat .gitattributes
* filter=git-crypt diff=git-crypt
.gitattributes !filter !diff
README.md !filter !diff

Add GPG user:

$ gpg --list-key
$ git-crypt add-gpg-user D9E1E3F8

Unlock after clone:

$ git-crypt unlock

export key and Unlock

$ git-crypt export-key ../gitcryptkey
$ scp ../gitcryptkey root@47.89.43.206:~/
$ ssh root@47.89.43.206
$ git-crypt unlock ../gitcryptkey