54

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." Commented Apr 14, 2011 at 8:38

3 Answers 3

38

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 
Sign up to request clarification or add additional context in comments.

8 Comments

These links both go to github.com/contact . I can't see requests themselves.
@PhilipDurbin yes, GitHub has since removed its discussion section
thanks, is there any public tracking of this feature request?
@BriandeAlwis Thank you. I have added this reference to the list of issues/discussions requesting this feature in my answer.
|
19

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

Github Follow Extension

2 Comments

Interesting. +1, nice workaround to my own answer above.
Unfortunately, I believe GitHub redesigned the UI and this doesn't appear to be working anymore
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 Comments

Interesting feedback, which confirms my answer. +1. Next question for GitHub: where is this "Feature Request List" for the users to vote on? ;)
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."
Another option is to setup project mirror (or just migrate there) on GitLab and preview history there. GitLab does support that.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.