tags:

views:

169

answers:

1

I'm trying to hook my git repository with Microsoft's Source Server feature such that people debugging into my binary will automatically pull source files down from github.com.

The git show command will get me the right file and version that I need, but since the debugger is not running on a computer with a local git repo of the project source code, I need "git show" to pull from github instead of a local directory. I'm imagining something like this:

git --no-pager "--git-dir=git://github.com/AArnott/dotnetopenid.git" show 93e76d5ff529b6c9921a984c3608c150ed4ee7a3

When the --git-dir argument is a local directory this works fine, but when it's a remote location it gives me an error such as:

fatal: Not a git repository: 'git://github.com/AArnott/dotnetopenid.git'

What git command will pull down a particular version of a particular file from a remote URL location?

+2  A: 

Unfortunately git does not support fetching individual remote files. There are three workarounds:

  • Use git fetch to get the remote history, then snatch the file from the local object store.
  • Use git archive to get a complete tree (e.g. git archive --remote=url master:somesubdir) in tar format on stdin.
  • Setup gitweb or something like that on the server and get the file through that.
Jan Krüger
This is great information. Nice workaround. Thanks.
b14ck
Bad news. But thanks.
Andrew Arnott
The trouble is I need ONE command to do all the work. It looks like at best I need at least two commands.
Andrew Arnott