Skip to content

Instantly share code, notes, and snippets.

@tsmoreland
Last active January 31, 2021 00:08
Show Gist options
  • Save tsmoreland/4be45f8860b55d0036fc76665f028037 to your computer and use it in GitHub Desktop.
Save tsmoreland/4be45f8860b55d0036fc76665f028037 to your computer and use it in GitHub Desktop.
Git Commands

Change default for all new repositories

git config --global init.defaultBranch main

alias log "pretty-print"

git config --global alias.lg "log --first-parent --graph --pretty=format:'%C(yellow)%h%Creset -%C(auto)%d%Creset %s %C(cyan)(%cr) %Cresetby %C(bold blue)%aN%Creset' --abbrev-commit --date=relative" (edited)

define line endings for commits

To prevent reporint mixed of windows/linux line ends being committed - choose one

git config --global core.autocrlf true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment