How to make github follow directory history after renames?

Github

Github Problem Overview


Once a directory is renamed, "git log" no longer shows its history, unless you force it to, by using "git log --follow".

Is there a way to force the "history" function on the GitHub web UI to use "--follow"?

Alternatively - is there any way to see pre-rename history on GitHub?

Github Solutions


Solution 1 - Github

This was requested in 2009 (Request 129), and then in 2010 (Request 897), and then in 2021 (github/feedback discussion 6964):

> I like this.
There could be other issues preventing us from plopping the --follow argument in.
I'll take a look and let you know.

... and then nothing for now.


Note: Git 2.6+ (Q3 2015) will propose that in command line: see "Why does git log not default to git log --follow?"


Note: Git 2.6.0 has been released and includes this feature. Following path changes in the log command can be enabled by setting the log.follow config option to true as in:

git config log.follow true

Solution 2 - Github

I wrote a chrome extension to enable this. Source on github.

Github Follow Extension

Solution 3 - Github

I've sent a mail to [email protected] (salutations removed):

> Will "git --follow" functionality ever be implemented on Github? If yes, where can I track its progress?

> (By "git --follow", I mean a way to easily see the object revisions before a rename. Currently, when an item is renamed, Github doesn't offer an easy way to display the directory / file history.)

Response:

> > Will "git --follow" functionality ever be implemented on Github? If yes, where can I track its progress?

> This is something a few other users have requested as well -- we might add it in the future. We currently don't have a public issue tracker, but I'll put another +1 next to it on the Feature Request List™ for the team to see.

So, "git --follow" is unfortunately not supported yet.

To get such functionality in the meantime, I guess you could write a user script that looks up the hash of the parent object, (recursively) look up its history and render the result.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGuyView Question on Stackoverflow
Solution 1 - GithubVonCView Answer on Stackoverflow
Solution 2 - GithubStafford WilliamsView Answer on Stackoverflow
Solution 3 - GithubRob WView Answer on Stackoverflow