I have the GitHub app on my Samsung but I don't see how and where to download files from GitHub onto my phone.
Am I an idiot or am I missing something? Please help.
Plain and simple: How to download files from github?
git - Download single files from GitHub - Stack Overflow
bash - Clone/download specific files from a GitHub repository - Stack Overflow
What steps to get software/files from github into ios usable app? - Mobile - SitePoint Forums | Web Development & Design Community
How do I download files from GitHub?
Is it free to download from GitHub?
How do I download everything from a GitHub folder?
Videos
I found this sub after angrily searching for this question on google. I found a post about a person asking to learn about github and still, zero comments about how to download stuff. I've been trying and looking for an answer by myself, with google, but failed at least 3 times in the last 6 years. This time my blood boiled in anger and frustration too much and I gave up on my self-learning principles to ask reddit for help. Can you (of course you can) help me?!
PS: sorry for my bad english. I learnt by my own principles.
PS2: Best Playstation games
PS3: You can call me names and make fun of my noobiness and bully me all you want. I, non ironically, love verbal aggression!
- Go to the file you want to download.
- Click it to view the contents within the GitHub UI.
- In the top right, right click the
Rawbutton. - Save as...
Git does not support downloading parts of the repository. You have to download all of it. But you should be able to do this with GitHub.
When you view a file it has a link to the "raw" version. The URL is constructed like so
https://raw.githubusercontent.com/user/repository/branch/filename
By filling in the blanks in the URL, you can use Wget or cURL (with the -L option, see below) or whatever to download a single file. Again, you won't get any of the nice version control features used by Git by doing this.
Update: I noticed you mention this doesn't work for binary files. You probably shouldn't use binary files in your Git repository, but GitHub has a download section for each repository that you can use to upload files. If you need more than one binary, you can use a .zip file. The URL to download an uploaded file is:
https://github.com/downloads/user/repository/filename
Note that the URLs given above, from the links on github.com, will redirect to raw.githubusercontent.com. You should not directly use the URL given by this HTTP 302 redirect because, per RFC 2616: "Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests."
Since the repo's on GitHub, which supports filters, easiest is probably to use its filter support.
git clone --no-checkout --depth=1 --filter=blob:none \
https://github.com/aosp-mirror/platform_frameworks_base
cd platform_frameworks_base
git reset -q -- \*.aidl
git checkout-index -a
which could probably be finessed quite a bit to get the files sent in a single pack instead of the one-at-a-time-fetch that produces.
For instance, instead of blob:none say blob:limit=16384, that gets most of them up front.
To do this in your own code, without relying on a Git install, you'd need to implement the git protocol. Here's the online intro with pointers to the actual Git docs. It's not hard, you send text lines back and forth until the server spits the gobsmacking lot of data you wanted, then you pick through it. You don't need to use https, github supports the plain git protocol. Try running that clone command with GIT_TRACE=1 GIT_PACKET_TRACE=1.
Not sure if this is what you wanted :
#!/usr/bin/env bash
get_github_file_list(){
local user=$1 repo=$2 branch=$3
curl -s "https://api.github.com/repos/$user/$repo/git/trees/$branch?recursive=1"
}
get_github_file_list aosp-mirror platform_frameworks_base android-11.0.0_r33 |\
jq -r '.tree|map(.path|select(test("\\.aidl")))[]'