one more git history poll: do you have an alias for a fancy `git log` or `git log —graph` incantation that I use to view your Git history?
also share it below if you’d like!
Discussion
one more git history poll: do you have an alias for a fancy `git log` or `git log —graph` incantation that I use to view your Git history?
also share it below if you’d like!
@b0rk I have `git lg` for `log --oneline --graph --all`: https://github.com/lucaswerkmeister/home/blob/746b487820bf2da4bae1eeee5564544a5120172a/.gitconfig#L5
I never set up a second alias, if I want anything else I’ll just type out the options (the tab completion helps ^^)
@b0rk I have `glog` aliased to `git log --oneline --decorate --graph`
@b0rk `log -n 16 --graph --date-order --decorate --format="%h %ad %an: %d %s" --date="format:%Y-%m-%d %H:%M"`
No color or bold, I hate that on the command line. The alias `l` above has limited length and only shows the current branch. There are variants `la` with `--all` and `ll` with `-n 9999`, and `lla` and/or `lal` (some chaos there).
@b0rk In recent time I do ctrl+r a lot, but don't define aliases
@b0rk https://github.com/DivineGod/devenv/blob/cc566faa45fd52a5e01be1cc5810f5eee11e61bb/git/helpers.sh#L13
pillar[1] is my own version of column(1) to support colours in the terminal
[1]: https://github.com/DivineGod/pillar/blob/main/README.md
@b0rk I mainly use ` lol = log --pretty=oneline --abbrev-commit --graph --decorate --all`, but I also have `llp` (log-last-pull) which is `log ORIG_HEAD..FETCH_HEAD` for changes introduced by the last pull.
@b0rk git log --graph --decorate --pretty=oneline --abbrev-commit --all
@b0rk
This is the alias section from my .gitconfig:
```
[alias]
slog = log --pretty=format:'%h - %an, %ar : %s'
ilog = log --pretty=format:'%h - %an, %ai : %s'
```
@b0rk git deploy-log, which takes a base rev and produces a 4-space indented oneline-like log. I use it to paste into commit messages when I roll forward a dependency or deploy a service from a separate repo
@b0rk I do have an alias but I use tig for the most part.
Tig is much more powerful but I just use it as a glorified log viewer where I can keybind Y to easily copy the highlighted SHA to my clipboard
@b0rk I have *four* aliases for this! (But if it gets complicated I usually use Fork.) https://github.com/geeksam/dotfiles/blob/bd8db09a956c453b7663ab89435eea9dc30cfc90/bash/aliases.bash#L31
@b0rk lg = log --graph -10 --format='%C(yellow)%h%Creset %s %Cgreen(%cr)%Creset'
@b0rk I have `git gl` aliased to `git log --graph --date=relative --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n%w(0,4,4)%-b%n%n%-N' $arg`