Questions tagged [git-blame]

git-blame is a git command that shows what revision and author last modified each line of a file.

git-blame is a git command that shows what revision and author last modified each line of a file.

https://www.kernel.org/pub/software/scm/git/docs/git-blame.html

git annotate is almost an alias for git blame (the output format is slightly different).

115 questions
7
votes
1 answer

If I Resolve a Conflict Does it Change Git Blame?

I'm trying to figure out whether a merge conflict was responsible for a bug, but I'm having difficulty because I'm not clear on how conflict resolution affects git blame. Let's say I have a file in master: a(); b(); c(); I modify it in…
machineghost
  • 33,529
  • 30
  • 159
  • 234
6
votes
2 answers

Speed up `git blame` on repository with many commits

I am trying to git blame the following file (run on my local machine) as it is too slow to generate the blame of GitHub: https://github.com/Homebrew/homebrew-core/blob/master/Formula/sqlite.rb But it is also very slow to run locally, over a minute…
user1424739
  • 11,937
  • 17
  • 63
  • 152
6
votes
1 answer

git blame --color-by-age set as default in git config

I would like to setup git blame --color-by-age as the default behavior whenever I invoke git blame. How would I configure my .gitconfig file to achieve this?
Kevin
  • 3,441
  • 6
  • 34
  • 40
6
votes
0 answers

Blame Error during SonarQube Scanner execution

I am using sonarqube-6.0 and i tried with a sample example to run with sonar-scanner i am getting the blame ERROR when ever I run any project in sonar-scanner The file Conf in sonar-scanner configuration is vi sonar-scanner.properties # # must…
klee
  • 1,554
  • 2
  • 19
  • 31
5
votes
3 answers

How to `git blame --ignore-revs-file` on a bare git repository

The command git blame --ignore-revs-file .git-blame-ignore-revs add.txt works on a non-bare repository locally on my machine but when I get the bare repository for the same repository locally and try the same command, the following happens: git…
5
votes
0 answers

Git: Reliably fetching blame history following renames

I am trying to construct a git log command that retrieves a file's history (following copies & renames) with the following properties: I want the log to be "closed under" annotation-following -- that is, if I git blame -elfwM the file any commit in…
Kvass
  • 8,294
  • 12
  • 65
  • 108
5
votes
1 answer

Git blame command to get list between two dates

Git gives since option git blame --since=3.weeks -- foo Is there a way I can get the blame list between two date? That is: something similar to git log --since and --until.
Red Ant
  • 315
  • 4
  • 17
5
votes
1 answer

git blame ignore whitespace option buggy?

Based on my understanding, the command git blame is supposed to show, for each line in a file, the author and the commit in which the line was last modified. So for example, if I run git blame -- "" and get the following output for line…
5
votes
2 answers

How can I search for a string that someone changed with git?

I would like to search for a specific string using git grep but I would like to filter the results by using git blame to know that the string I'm looking for was changed by a specific person. I just don't know how can I combine them to get the…
VaTo
  • 2,936
  • 7
  • 38
  • 77
5
votes
2 answers

How to keep previous committer name in git?

In order to clean our code we want to use astyle. The matter is that we want someone to do the job, but blaming previous committer (real author of the code and not the one who cleans). Is there a way to do it safely in git ?
Poko
  • 792
  • 2
  • 8
  • 24
4
votes
1 answer

Use the same commit abbreviation length for git blame as other commands

The git blame command shows commit hashes abbreviated to a length that is one character longer than other commands. For example: $ git log --oneline 9fb6f706 (HEAD -> master) second commit 0af747a8 first commit $ git blame foo 9fb6f7064…
Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
4
votes
0 answers

Tracking specific lines of code between revisions in git / GitHub

When a line of code is submitted to a git repository, its line number may change in future commits, by code being added or removed above it, while fundamentally still being the same line. Given a permalink for a code-snippet, is there an API that…
mhelvens
  • 4,225
  • 4
  • 31
  • 55
4
votes
2 answers

How does --no-ff merge break bisect and blame?

Understanding the Git Workflow article says, So you add a new rule: “When you merge in your feature branch, use –no-ff to force a new commit.” This gets the job done, and you move on. Then one day you discover a critical bug in production, and…
sherlock
  • 2,397
  • 3
  • 27
  • 44
3
votes
0 answers

Git commit without a new author (keep old lines' authors)

I'm adding eslint/prettier to my repository for code formatting, styling, etc. The issue is that when people run git blame I will now be know as the author of tons of lines of code in our project. I found this blog post which shows that I can use…
Brady Dowling
  • 4,920
  • 3
  • 32
  • 62
3
votes
1 answer

Robustly retrieve SHA and line content with Git blame (Python3)

I'm contributing to a package (Python >= 3.5) that uses git blame to retrieve information on files. I'm working on replacing the GitPython dependency with custom code supporting just the small subset of functionality we actually need (and provide…
uli_1973
  • 705
  • 1
  • 5
  • 22