Git dates
Setting up ubuntu environment variables
Git dates
Say you want some date privacy, so that the default commit date would be near linux epoc.
Edit ~/.pam_environment and insert the following lines:
The small details here:
* ~/.pam_environment won't handle whitespace, even inside "", using T instead
* Git won't accept "0 +0000" as valid time using this format.
GIT_AUTHOR_DATE="100000000T+0000"
GIT_COMMITTER_DATE="100000000T+0000"
Helpful links:
https://kevin.deldycke.com/2013/06/git-invalid-date-format/
https://github.com/git/git/blob/v2.3.0/Documentation/date-formats.txt
https://help.ubuntu.com/community/EnvironmentVariables
http://mcs.une.edu.au/doc/pam/html/sag-pam_env.html
Up!
GitHub/GitLab setup
Say you want to use GitHub/GitLab but don't want to enter user pass each time, and want your actions be signed.
Links are for GitHub, it is pretty much the same for GitLab.
Follow the links, then in order to commit without entering password:
* create file with the password: ~/.keys/gpg_pass.txt
* create sh file to read the file into gpg:
file: ~/bin/pass_gpg.sh
content: gpg --no-tty --passphrase-file=/home/daniel/.keys/dcode_gpg_pass.txt $*
* set this batch as gpg program for git:
git config --global gpg.program "/home/daniel/bin/pass_gpg.sh"
* Tell git what key to use:
git config --global user.signingkey keyname
* Tell git to always sign:
git config --global commit.gpgsign true
The small details here:
* Use gpg, not gpg2, I couldn't make gpg2 read password from file in a normal way.
* Without --no-tty Rubymine failed to commit.
* Use git log --show-signature to see the signature as expected
* When cloning, use the SSH option, not the HTTPS one, you can check state using git remove -v
expecting git@github.com
* Check at GitHub commits you have "Verified" tag on the signed commit.
Helpful links:
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
https://help.github.com/articles/signing-commits-with-gpg/
Up!