53

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?

1
  • 5
    I've opened a GitHub ticket, and got the following reply "There isn't currently. This is a known issue, I have a ticket open to get it fixed."
    – Guy
    Apr 14, 2011 at 8:38

3 Answers 3

37

Update June 2022: GitHub now supports viewing commit history across file renames and moves!

View commit history across file renames and moves.


2011: 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
5
  • 8
    These links both go to github.com/contact . I can't see requests themselves. Jan 11, 2013 at 19:34
  • 2
    @PhilipDurbin yes, GitHub has since removed its discussion section
    – VonC
    Jan 11, 2013 at 19:35
  • 4
    thanks, is there any public tracking of this feature request? Jan 11, 2013 at 19:40
  • 2
  • 1
    @BriandeAlwis Thank you. I have added this reference to the list of issues/discussions requesting this feature in my answer.
    – VonC
    Jan 6, 2022 at 17:07
19

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

Github Follow Extension

2
  • Interesting. +1, nice workaround to my own answer above.
    – VonC
    Oct 3, 2015 at 15:47
  • Unfortunately, I believe GitHub redesigned the UI and this doesn't appear to be working anymore Oct 10, 2020 at 22:46
17

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.

3
  • 2
    Interesting feedback, which confirms my answer. +1. Next question for GitHub: where is this "Feature Request List" for the users to vote on? ;)
    – VonC
    Feb 2, 2014 at 8:49
  • 1
    Another update: "Thanks for getting in touch. This hasn't been shipped, however we definitely appreciate the feedback. I'll add a +1 to this item on our internal Feature Request List, however I can't make any promises if/when this might be available."
    – user247702
    Oct 14, 2014 at 15:49
  • Another option is to setup project mirror (or just migrate there) on GitLab and preview history there. GitLab does support that.
    – jangorecki
    Sep 17, 2019 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.