Git
Resources:
- A Cheatsheet of High-Frequency Git Commands
- “Here Are 7 Git Commands Every Developer Should Know” by Indrek Lasn
Temporary cache credentials for git (example is cache for 1 hour):
git config credential.helper 'cache --timeout=3600'
To disable automatic CR/LF convesion in gihub desktop:
git config --global core.autocrlf false
Overleaf:
# Add the remote
git remote set-url ol https://nima.mahmoudi%40ualberta.ca:PASS@git.overleaf.com/PROJECT
# change files to the remote
git reset --hard ol/master
GPG To Sign Commits
# Gpg to sign git commits
# using existing key
gpg --import public.key
gpg --list-secret-keys --keyid-format LONG
# replace 3AA5C34371567BD2 with your gpg key ID
git config --global user.signingkey 3AA5C34371567BD2
echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
export GPG_TTY=$(tty)
# Make sure your name and email are set in git config
git config --global user.name "Your Name"
git config --global user.email you@example.com
# Check the sign off after doing the commit
git log --show-signature -1