Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to wrap git log

📅 2016-Jan-13 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ fold, git, log, wrap ⬩ 📚 Archive

I display the log of Git in my own custom format. When the display text for a commit is longer than the width of the terminal, it is just truncated!

I could not find any way to make Git wrap the display of log message in the terminal. What I instead do is to pipe the git log through the classic Unix fold command:

$ git log | fold

By default, fold wraps to a width of 80 columns. You can specify the width of your terminal to it using the -w or --width option.

Tried with: Git 1.9.1 and Ubuntu 14.04

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧