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.helper
Cleanup 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 cat
Work 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.gitconfig
Git 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:
G
for a good (valid) signatureB
for a bad signatureU
for a good signature with unknown validityX
for a good signature that has expiredY
for a good signature made by an expired keyR
for a good signature made by a revoked keyE
if 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>