Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to git blame a directory

Tags:

git

I would like to know how to use git blame to know who created a single directory.

When I try:

git blame DIRECTORY_NAME 

I get:

fatal: no such path DIRECTORY_NAME in HEAD 

Incidentally, the directory is empty. Any suggestions?

like image 853
Sung Cho Avatar asked Dec 14 '15 05:12

Sung Cho


People also ask

How do I blame in git?

The git blame command is used to examine the contents of a file line by line and see when each line was last modified and who the author of the modifications was. The output format of git blame can be altered with various command line options.

How do I git blame on GitHub?

On GitHub.com, navigate to the main page of the repository. Click to open the file whose line history you want to view. In the upper-right corner of the file view, click Blame to open the blame view.

How do you use blame?

to think or say that someone or something is responsible for something bad blame somebody/something (for something) She doesn't blame anyone for her father's death. A dropped cigarette is being blamed for the fire. blame something on somebody/something Police are blaming the accident on dangerous driving.

How do I go to a directory in git?

Browse to the desired Directory through Commands in Git Bash Open your Git Bash. Type the following command cd <path of the directory> and press enter.


1 Answers

Try getting a log of just that directory, and use the -p option to see the exact changes that occurred.

$ git log -p <path to directory> 

This still might not tell you exactly who created the directory, since git seems to focus more on file content, but you might get some helpful clues just from seeing the first time any content was added to it.

like image 59
Jon Carter Avatar answered Oct 01 '22 07:10

Jon Carter