Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git blame - ignore uncommitted changes

Tags:

git

blame

Partial output from git blame <file>:

    ...
   d6182477 (<author>          2012-06-22 09:44:02 -0400 239) ...
   d6182477 (<author>          2012-06-22 09:44:02 -0400 240) ...
   25f98f3f (<author>          2012-06-15 15:44:00 -0400 245) ...
   25f98f3f (<author>          2012-06-15 15:44:00 -0400 246) ...
   35853aa2 (<author>          2012-06-22 08:12:41 -0400 247) ...
   25f98f3f (<author>          2012-06-15 15:44:00 -0400 248) ...
-> 00000000 (Not Committed Yet 2012-06-27 08:33:35 -0400 249) ...
-> 00000000 (Not Committed Yet 2012-06-27 08:33:35 -0400 249) ...
   25f98f3f (<author>          2012-06-15 15:44:00 -0400 250) ...
   35853aa2 (<author>          2012-06-22 08:12:41 -0400 251) ...
   25f98f3f (<author>          2012-06-15 15:44:00 -0400 252) ...
    ...

How does one get git blame to ignore uncommitted changes from the file?

like image 691
vergenzt Avatar asked Jun 27 '12 12:06

vergenzt


People also ask

What is git blame ignore revs?

git-blame-ignore-revs . It expects one commit hash per line, and all commits in the file will be ignored by git blame . You can add comments to this file by prefixing it with a # , and I'd recommend commenting each sha to explain why it's being skipped. $ cat .git-blame-ignore-revs. # Upgrade to Prettier 2.0.

What is git blame used for?

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.

How to use Git blame PyCharm?

Right-click the gutter in the editor or in the Differences Viewer and select Annotate with Git Blame from the context menu. You can assign a custom shortcut to the Annotate command: go to the Keymap page of the IDE settings Ctrl+Alt+S and look for Version Control Systems | Git | Annotate.


1 Answers

git blame HEAD <file>

From the git blame manual:

Annotates each line in the given file with information from the revision which last modified the line. Optionally, start annotating from the given revision.

like image 194
vergenzt Avatar answered Oct 11 '22 14:10

vergenzt