Thomas Vervik
Thomas Vervik

Reputation: 4545

View git history for folder

How can I view git log history for all files within a folder ?

I have found several posts on how to show log for a specific file, but haven't found for a specific folder.

Upvotes: 213

Views: 124447

Answers (2)

knittl
knittl

Reputation: 265864

You can use foldername or 'foldername/*'.

git log -- path/to/folder
git log -- 'path/to/folder/*'

History of renamed files will not be followed with this method.

Please note that -- is optional as well. From git help log:

[--] <path>...

           Show only commits that are enough to explain how the files that match the specified paths came to be. See History Simplification below for
           details and other simplification modes.

           Paths may need to be prefixed with -- to separate them from options or the revision range, when confusion arises.

Upvotes: 271

OSdave
OSdave

Reputation: 8585

if you want to use a graphic tool, such as gitk, it works the same:

gitk -- path/to/folder

Upvotes: 74

Related Questions