git > show file changes and history

Pavol Kutaj
Nov 25, 2020

1. use-case

  • I repeatedly pull changes from repos and need to quickly check what has happened to config files
  • My colleagues troubleshoot data pipelines and, learning from them, I need to see what they have done to the files in question

2. pull & log -p

  • this is not git diff
  • run git pull → fetch & merge potential merges
  • run git log -p → see what has been changed

3. file history: who & commit message

git log –pretty=format:”%C(auto)%h%d%Creset %C(cyan)(%ci)%Creset %C(green)%cn <%ce>%Creset %s” –name-status –date=short –all –full-history — FILENAME

4. sources

--

--

Pavol Kutaj

Today I Learnt | Infrastructure Support Engineer at snowplow.io with a passion for cloud infrastructure/terraform/python/docs. More at https://pavol.kutaj.com