Tim Brigham Tim Brigham - 1 year ago 74
Git Question

Select a single file history out of Git?

I use Git to keep a version history of config files. For this purpose there are no branches. I keep a ton of these in the same repository, some of which have sensitive data. I need to zip up and send a history of a single file out of this repository to a vendor to diagnose a problem. How do I do so?

Answer Source
  • git log -p <file> generates all the patches used for a file.
  • git blame <file> shows what revision and author last modified each line of a file. docs
  • gitk <file> gives you better visualization of the changes. docs