8

I can do git clone like so ...

 git clone https://github.com/stackforge/puppet-heat.git

... with no problems. But I want to exclude all the git meta stuff that comes with the cloning, so I figured I would use git archive but I get this error:

$ git archive --remote=https://github.com/stackforge/puppet-heat.git 
fatal: Operation not supported by protocol.

Anyone know why or what I am doing wrong?

4

I would simply run the git clone as you've described and then delete the .git directories that are dispersed throughout the cloned directory.

$  find puppet-heat/ -name '.git' -exec rm -fr {} +
  • Thanks. I found the "Download Zip" link on their github and I just did a wget https://github.com/stackforge/puppet-heat/archive/stable/havana.zip and unzipped it. – Red Cricket Jun 11 '14 at 0:58
6

You can use github's svn support:

svn export https://github.com/user/project/trunk

More details here:

https://stackoverflow.com/questions/9609835/git-export-from-github-remote-repository

1

git archive is still the right way to go:

git clone https://github.com/stackforge/puppet-heat.git cd puppet-heat git archive

The reason your approach doesn't work is - obviously - that github doesn't (or didn't) support the remote archiving. It would mean, that the archive is actually created as a file on the github server which is then sent.

So just clone the repo and run git archive on your clone.

1

FYI I hit the same error with bitbucket. I switched protocols from https to ssh and it worked.

e.g:

git archive --remote=youruser@github.com/stackforge/puppet-heat.git 

Of course you need to have the public/private keys setup for this to work.

I have heard that github doesn't support remoting, but for others with this problem the above fixed it for me at least.

As our repo is huge, cloning it is not really an option if we just want to do the equivalent of an svn export.

  • @john-lilttle Have you tried the git archive command against github or just bitbucket? – AlikElzin-kilaka May 2 '18 at 5:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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