Git Tips

Useful Aliases

alias.lg=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%C(bold)%d%Creset %s %C(brightgreen)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --branches

alias.sizeof=ls-tree -r -l HEAD --

Scenarios

In the event you have commits on main which should be a topic branch

  • git switch -c topic
  • git switch -C main origin\main