I have a private repo and I want to download a branch files from it. My environment doesn't have the git command installed. It would be great if I can do this with Python/PyGithub
Asked
Active
Viewed 181 times
-1
-
What is your question? – Maël Pedretti Mar 01 '18 at 16:18
-
Why can't you just install the git command? – mkasberg Mar 01 '18 at 16:33
2 Answers
1
Do you just want to download files from the repository ? if yes you can copy the files to a local destination.
If you want to checkout the new dev branch off of the repository you an use the UI to do that.

rshdzrt
- 125
- 7
0
Your repo is on github, right ?
Through the GUI : when you view the content of a file, you can see a Raw
button on the top right part of the file view.
This points you to a url, which will give you the raw content of said file.
Here is an example :
Readme.md
of the golang repo can be viewed here :
https://github.com/golang/go/blob/master/README.md- raw content of same file can be viewed here :
https://raw.githubusercontent.com/golang/go/master/README.md
You simply have to download this file, e.g :
curl https://raw.githubusercontent.com/golang/go/master/README.md
For a file in a private repo, you will need to also pass some credentials.

LeGEC
- 46,477
- 5
- 57
- 104