Search code examples
gitgit-blame

How to use git blame to track change deep in history


I've tried to do this on GitHub but I've keep getting timeout error.

I want to use git blame to get the changes and commits before single commit.

On GitHub I've tried to us git blame to find one change that I'm interested get the commit of the change and get git blame on commit before that commit.

The reason why I want this is that the last change to particular file was refactor and I want to know when line that was before it was added.

git blame have --reverse but according to man I need to use 2 revisions, I want one and to the beginning.


Solution

  • I'm not sure a web interface is the best option here, especially since you are getting timeouts. What I would do is first clone the repository locally. Then checkout the commit before the refactor, and use git blame or just check the contents of the file to see what it was before the refactor process. You can use your favourite git tools (and timeouts are not an issue).