Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 4

Pull specific file from a folder in a repo and save it at location X

Solved! Go to Solution.

Greetings guys,

 

I have a question about GIT. I have a private repo here on GitHub and I would like to automate via cronjob the distrobution of a single file from it. 

 

Basically I want to pull that specific file and put it into the home folder and overwrite existing file. 

The file is located in the private repo under FolderA/.file1q2

 

Can someone guide me how this can be archieved? Is creating a empty repo really necessary? Then I would rather just select a global location for that empty report anf afterwards jut move the file via mv to the location. 

 

Regards,

 

Alex

 

3 Replies
Community Manager
Message 2 of 4

Re: Pull specific file from a folder in a repo and save it at location X

There are a few different ways to achieve what you want, but yes, probably the easiest and most reliable would be to clone the repository (or pull the latest revision if you've already cloned it) and then copy the file you want to the location you want it to be in.

 

I hope that helps!

Copilot Lvl 2
Message 3 of 4

Re: Pull specific file from a folder in a repo and save it at location X

Hi Thanks for the reply, do you have the two other options handy? 

Otherwise I'll probably really need to clone the repo?

Solution
Community Manager
Message 4 of 4

Re: Pull specific file from a folder in a repo and save it at location X

The only one I have a handy link to is the sparse checkout technique.