til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Git Alias to Show Affected Files in Last N commits

I never heard about Git aliases before. Apparently you can define git command aliases, so here goes a cool tip for getting started with aliases and of course a nice way to see what files where involved a specific number of commits back

Edit your ~/.gitconfig and a alias section

[alias]
    lsch = "!f() { git diff --name-status -r "HEAD~$1"; }; f"

And then you can do:

$ git lsch 10

Output from my TIL repository, when writing this til (prior too committing)

$ git lsch 10
M   README.md
M   _config.yml
A   bash/create_dir_for_own_completions.md
M   editorconfig/perl.md
A   mojolicious/enable_syntax_highlighting_for_configuration_files.md
A   ubuntu/install_updates_via_cli.md
A   xml/fast_xml-xsd_validation_on_cli.md

Have fun exploiting the git command aliases

References