https://developer.lsst.io/v/DM-5063/tools/git_setup.html
[user] ;user details change the email name = Naval Kishor Jha email = er.navalkishor@yahoo.in [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true precomposeunicode = true autocrlf = true # VSCode #editor = code --wait # Don't consider trailing space change as a cause for merge conflicts whitespace = -trailing-space [color] # Enable colors in color-supporting terminals ui = auto [grep] break = true heading = true lineNumber = true # Consider most regexes to be ERE extendedRegexp = true [alias] # List available aliases aliases = !git config --get-regexp alias | sed -re 's/alias\.(\S)\s(.)$/\1 = \2/g' # Command shortcuts ci = commit co = checkout st = status # Display tree-like log, because default log is a pain… lg = log --date=relative --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ad)%Creset' # Useful when you have to update your last commit # with staged files without editing the commit message. oops = commit --amend --no-edit # Ensure that force-pushing won't lose someone else's work (only mine). push-with-lease = push --force-with-lease # Rebase won’t trigger hooks on each "replayed" commit. # This is an ugly hack that will replay each commit during rebase with the # standardcommit
command which will trigger hooks. rebase-with-hooks = rebase -x 'git reset --soft HEAD~1 && git commit -C HEAD@{1}' # List local commits that were not pushed to remote repository review-local = "!git lg @{push}.." # Edit last commit message reword = commit --amend # Undo last commit but keep changed files in stage uncommit = reset --soft HEAD~1 #sets things up the way they were before the commit undo = reset --soft HEAD^ stash-all = stash save --include-untracked glog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' # Remove file(s) from Git but not from disk untrack = rm --cache -- tags = "tag -l" branches = "branch -a" remotes = "remote -v" # Create a commit that will be automatically squashed as a fixup when you # rungit rebase --autosquash
fixup = "commit --fixup=HEAD" # Better diffs for prose wdiff = "diff --color-words" alias = ! git config --get-regexp ^alias\\. | sed -e s/^alias\\.// -e s/\\ /\\ =\\ / p = push ll = 'log --oneline' glist = config --global alias.gl 'config --global -l' se = !git rev-list --all | xargs git grep -F