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?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Guy
  • 12,250
  • 6
  • 53
  • 70
  • 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 '11 at 08:38

3 Answers3

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
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
19

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

Github Follow Extension

Stafford Williams
  • 9,696
  • 8
  • 50
  • 101
17

I've sent a mail to support@github.com (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.

Rob W
  • 341,306
  • 83
  • 791
  • 678
  • 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 02 '14 at 08: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 '14 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 '19 at 19:28