Understanding branch history in text is hard. –graph flag shows visual tree.
Pretty Graph:
git log --graph --oneline --all # Output: # * abc1234 (HEAD -> main) Merge feature # |\ # | * def5678 (feature) Add feature # | * ghi9012 Feature progress # * | jkl3456 Fix bug # |/ # * mno7890 Initial commit
Prettier Version:
git log --graph --pretty=format:'%C(yellow)%h%Creset -%C(red)%d%Creset %s %C(green)(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit # Shows: # - Colored commit hash # - Branch/tag names # - Commit message # - Relative time # - Author name
Create Alias:
git config --global alias.tree "log --graph --oneline --all" # Now use: git tree
See branch history at a glance!
