0

I have some of my work available on a git repo which contains 2 folders. Now I want to transfer these 2 folders to a remote server using psftp in putty.

I have tried downloading the folders from git and then pusing them to server by first connecting to it using open "host.name" and then using the following command for sending the entire directory: put -r mydir but this did not work as I was unable to see the directory within the server. How can I do that so that the folder structure is maintained and I don't have to send each file one by one?

Cœur
  • 37,241
  • 25
  • 195
  • 267
rehan
  • 143
  • 3
  • 17
  • 1
    "*did not work as I was unable to see the directory within the server*" Did `put` failed with an error or did it transfer files without an error? If there are no errors you should see you transferred directory on the server in a corresponding directory. You just have to find out what is that corresponding directory. Perhaps you should have `cd` to a different directory on the server between `open` and `put`. – phd May 11 '20 at 15:09
  • @phd that worked! you were right about the directory. but currently i am downloading the folders from git and then transferring. is there a way that i can directly transfer it from git insteade of first downloading it to my local drive? – rehan May 13 '20 at 08:54
  • You have some commands that download the folders from git to you local host. Can you run these commands at the server? This way you download the folders from git directly to the server and there will be no need to transfer them from your local host. – phd May 13 '20 at 08:57
  • @phd unfortunately not because i can't install git on the server. that's why I am using putty for transferring folders – rehan May 13 '20 at 08:59
  • How do you suppose to download something from git without git? No way. You can download an archive of the repository if your git hosting allows that. – phd May 13 '20 at 09:02
  • @phdyes my git hosting allows downloading an archive – rehan May 14 '20 at 09:59
  • Then use `curl` or `wget` to download an archive, and extract the subfolders from the downloaded archive. – phd May 14 '20 at 10:41

0 Answers0