Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you find out which commit a file mode change came from?

Tags:

git

blame

I'm familiar with using git blame on the commandline to show which commit changed a particular line of a file.

Is there a similar function to show which commit last changed the file "mode"/flags? E.g. setting or unsetting the executable flag.

like image 784
Armand Avatar asked Aug 24 '17 09:08

Armand


People also ask

How can I tell which files were changed in a commit?

To find out which files changed in a given commit, use the git log --raw command.

Which command would you use to view the history of commits?

The most basic and powerful tool to do this is the git log command. By default, with no arguments, git log lists the commits made in that repository in reverse chronological order; that is, the most recent commits show up first.

What command can you use to see what changes have been staged which haven't and which files aren't being tracked by git?

The git status command displays the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git.


1 Answers

You could use git log with the --summary flag and search the output for mode changes:

git log --summary -- path/to/file

From the documentation:

--summary

Output a condensed summary of extended header information such as creations, renames and mode changes.

like image 150
Eugene Yarmash Avatar answered Oct 05 '22 05:10

Eugene Yarmash