views:

89

answers:

2

I want to do:

 git log -p [path/to/file]

in GitHub because I want it to look pretty, and I want a link to send to someone else w/o the code.

Thanks!

Matt

+5  A: 

The following URL will show all the commits for a single file in a format similar to git log -p:

http://github.com/<username>/<project>/commits/<branch>/<path/to/file>

...where:

  • <username> is the username of the person that owns the repo
  • <project> is the repo name
  • <branch> can be 'master' or any other branch
  • <path/to/file> is hopefully self-explanatory

Picking at (somewhat) random, here is an example from the vim-fugitive repo.

Tim Henigan
+1. More of those Commits API: http://develop.github.com/p/commits.html (in the GitHub API section http://develop.github.com/)
VonC
That's git log path/to/file. I want git log -p path/to/file.
MattDiPasquale
A: 

An alternative to the direct URL answer (which BTW is perfectly correct) using GitHub's interface is to:

  • Click on 'Source' view
  • Switch to a desired branch
  • Look for the file you want until you get to the actual source view for the file
  • Click 'history' on the top right corner
Zubin