1

I am trying to download a private git repo.

when I do git clone https://<DEV_USER>:<DEV_PWD>@github.<corpName>.net/Svcs/repo.git

it works!

But I dont really need all the git history. I just need the repo as a file directory. Hence I was trying to archive.

git archive --remote=<DEV_USR>:<DEV_PWD>@github.<corpName>.net:Svcs/repo.git

I get the following error

Could not resolve hostname <DEV_USER>: nodename nor servname provided, or not known
fatal: The remote end hung up unexpectedly
Gayatri
  • 453
  • 1
  • 6
  • 18
  • 1
    Possible duplicate of [Using git to get just the latest revision](https://stackoverflow.com/questions/1209999/using-git-to-get-just-the-latest-revision) – Matthew Strawbridge Oct 02 '18 at 22:02
  • I did refer the post but it basically talks about getting minimal git history, I basically want no git history tied to the repo. Just plain ol' file directory. – Gayatri Oct 03 '18 at 15:29
  • 1
    @Gayatri https://git-scm.com/docs/git-archive#git-archive---remoteltrepogt: the argument should be one shown in https://git-scm.com/docs/git-upload-archive – VonC Oct 03 '18 at 15:43

1 Answers1

0

The URL is incorrect:

  • if you use an SSH one, you would not use your GitHub Enterprise login pasword, but git@github.<corpName>.net:Svcs/repo.git (and your SSH keys would be enough to authenticate you)

  • if you use your credentials (login/password <DEV_USR>:<DEV_PWD>) then use an HTTPS URL https://<DEV_USR>:<DEV_PWD>@github.<corpName>.net/Svcs/repo.git

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250