Skip to content

Instantly share code, notes, and snippets.

@jjones646
Last active April 29, 2016 05:18
Show Gist options
  • Save jjones646/d80561c7fdc260bd4611d6e55057d5e4 to your computer and use it in GitHub Desktop.
Save jjones646/d80561c7fdc260bd4611d6e55057d5e4 to your computer and use it in GitHub Desktop.
Basic shell script to set a few global git configurations for easier log filtering. After running, use the `git graph` command for viewing a repository's merge history.
#!/bin/bash
# git-tweaks.sh
# Setup a slick default 'git log' display
git config --global log.date relative
git config --global log.abbrevCommit true
git config --global format.pretty 'format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset"'
# Alias for 'git graph' since log.graph isn't a valid config
git config --global alias.graph "log --graph"
# Use .mailmap name author mappings when found in root of a repo
git config --global log.mailmap true
# Show the config values
git config --list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment