Git
Using HTTPS auth
Section titled “Using HTTPS auth”Save credentials to cache
git config --global credential.helper cachegit config --global --list# To removegit config --global --unset credential.helperCleanup old stashes
Section titled “Cleanup old stashes”# list stashed older then 2 monthsgit stash list --before="2 month ago" --date=relative
STASHES_FOR_CLEANUP=$(git stash list --before="2 month ago" | sort -r)gh cli
Section titled “gh cli”Configure pager
# List all configsgh config list# Set pager to catgh config set pager catWork git config
Section titled “Work git config”# Include work conf (only if file exists)[include] path = ~/dotfiles/work/work.gitconfig
# Based on folder[includeIf "gitdir:~/work/**"] path = ~/dotfiles/work/work.gitconfig
# Based on remote[includeIf "hasconfig:remote.*.url:git@github.com:orgname/**"] path = ~/dotfiles/work/work.gitconfigGit credentials in Windows
Section titled “Git credentials in Windows”Windows uses Credential Manager to store git credentials (Control Panel \ Credential Manager).
Check with git config --list to see if credential.helper=manager.
Signatures in log
Section titled “Signatures in log”Using option format:<format-string> with %G? format-string show signature status for commits:
Gfor a good (valid) signatureBfor a bad signatureUfor a good signature with unknown validityXfor a good signature that has expiredYfor a good signature made by an expired keyRfor a good signature made by a revoked keyEif the signature cannot be checked (e.g. missing key) and “N” for no signature
e.g. with prettylog = log --graph --pretty=format:'%C(red)%h%C(reset) -%C(yellow)%d%C(reset) %s %C(green)(%cr) %C(bold blue)<%an %G?>%C(reset)' --abbrev-commit --date=relative will result something like:
* 6d4c2db - some commit message (5 weeks ago) <Petteri Vaarala G>