0

I am on a Mac OS X Mojave. From the command line, I want to access a private repo (which I do not own but have access to) located at

https://github.com/<ORG_NAME>/<PROJECT-NAME>

By "access," I mean that I only need to download the project directory to my local machine. I only need the files and directory structure. I do not need to checkout the repo or get the .git history.

How can I do this from the command line?

This question is different because it deals with the scenario where I own the repo. Which I don't. Also that question uses the clone command. And I don't need a clone to checkout or the git history. I just need a copy of the files as previously stated.

This answer suggests the following.

git clone https://<username>:<password>@github.com/<ORG_NAME>/<PROJECT-NAME>.git

But they said you need to enter info at the prompt. I would like to avoid entering info at the prompt because this is part of a larger automation routine I'm making. So I'd like to have the command line instructions self-contained.

Edit: I also found this additional information, but I still can't figure it out from there.

Let Me Tink About It
  • 15,156
  • 21
  • 98
  • 207
  • A deploy key may help with your permissions question https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys. It may help to describe what you are trying to do in case there is another solution. – osowskit Nov 30 '18 at 00:27
  • https://stackoverflow.com/questions/29368837/copy-a-git-repo-without-history – miken32 Nov 30 '18 at 03:49
  • You can try to [download the entire repo as zip from hithub](https://stackoverflow.com/a/47857787/7976758) or you can use [`git archive`](https://stackoverflow.com/a/13751126/7976758). – phd Nov 30 '18 at 06:04

0 Answers0