Skip to content

Instantly share code, notes, and snippets.

@prabeengiri
Last active August 16, 2021 16:56
Show Gist options
  • Select an option

  • Save prabeengiri/23d5fd27c4cad52a9029 to your computer and use it in GitHub Desktop.

Select an option

Save prabeengiri/23d5fd27c4cad52a9029 to your computer and use it in GitHub Desktop.
Git Config
# created .gitconfig file inside the $home(HOME) folder `/Users/[username]/` if not present
[user]
name = prabeen
email = prabeen.giri@gmail.com
[color]
ui = auto
[alias]
lg = log
lg2 = log --oneline --decorate
# This will give the commit history of all the branches in local and remote. Just use git log to see history of current branch.
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(red)%h%Creset %C(cyan)%an%Creset %C(green dim)%ad%Creset %C(bold black)%s%Creset %C(bold yellow)%d%C(reset)' --all
# Pretty Stash List
sl = stash list --pretty=format:\"%C(red)%h%C(reset) - %C(dim yellow)(%C(bold magenta)%gd%C(dim yellow))%C(reset) %<(70,trunc)%s %C(green)(%cr) %C(bold blue)<%an>%C(reset)\"
[log]
date = relative
[format]
pretty = format:%C(red)%h%Creset %C(cyan)%an%Creset %C(green dim)%ad%Creset %C(bold black)%s%Creset %C(bold yellow)%d%C(reset)
# %C is to escape string like color, %Cbold,
# %Creset will stop to apply color or configs. If %Creset is not used, then it will apply same color over all string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment