Zwykle używam
git log --graph --full-history --all --pretty=format:"%h%x09%d%x20%s"
Z kolorami (jeśli twoja skorupa to Bash):
git log --graph --full-history --all --color \
--pretty=format:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"
Spowoduje to wydrukowanie reprezentacji tekstowej w następujący sposób:
* 040cc7c (HEAD, master) Manual is NOT built by default
* a29ceb7 Removed offensive binary file that was compiled on my machine and was hence incompatible with other machines.
| * 901c7dd (cvc3) cvc3 now configured before building
| * d9e8b5e More sane Yices SMT solver caller
| | * 5b98a10 (nullvars) All uninitialized variables get zero inits
| |/
| * 1cad874 CFLAGS for cvc3 to work successfully
| * 1579581 Merge branch 'llvm-inv' into cvc3
| |\
| | * a9a246b nostaticalias option
| | * 73b91cc Comment about aliases.
| | * 001b20a Prints number of iteration and node.
| |/
|/|
| * 39d2638 Included header files to cvc3 sources
| * 266023b Added cvc3 to blast infrastructure.
| * ac9eb10 Initial sources of cvc3-1.5
|/
* d642f88 Option -aliasstat, by default stats are suppressed
(Możesz po prostu użyć git log --format=oneline, ale spowoduje to powiązanie zatwierdzania wiadomości z liczbami, co wygląda mniej ładnie IMHO).
Aby utworzyć skrót do tego polecenia, możesz edytować ~/.gitconfigplik:
[alias]
gr = log --graph --full-history --all --color --pretty=tformat:"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s%x20%x1b[33m(%an)%x1b[0m"
Jednak, jak zauważa Sodel Vociferous w komentarzach, tak długie polecenie formatowania jest trudne do zapamiętania. Zwykle nie stanowi to problemu, ponieważ można go umieścić w ~/.gitconfigpliku. Jeśli jednak czasami musisz zalogować się na zdalnym komputerze, na którym nie możesz zmodyfikować pliku konfiguracyjnego, możesz użyć prostszej, ale szybszej wersji:
git log --graph --oneline