How to download files from the GitHub on PC and Mobile?

How to download files from the GitHub on PC and Mobile

GitHub is one of the widely used software code hosting and version control software. Due to its open-source nature, most IT Firms and freelance developers have opted for this as a daily driver.

But, if you've stored your code in a centralized repository like Github and now you want to download that code. How can you achieve that?

This tutorial will show how we can download those files into our local directory.


    How to download files from GitHub?

    There are multiple ways to download the GitHub files and save them to your PC. If you want to download the single file then follow the given steps

    A. Using the Manual method

    I. Open the GitHub website and sign in with credentials

    II. Now, open the project folder from the GitHub repository

    Download the raw file from GitHub folder

    III. Now, open the file that you want to download

    Download the file from Github

    IV. Then, select the Raw option to open the code in Raw format

    Download the raw file from Github

    V. Try to save it using CTRL + S, and it will get saved into your device

    B. Using the Copy-paste Method

    If you don't want to use the previous method or want to save time, else you can also save the file manually just copy the code and paste it into notepad

    Copy RAW github file

    Save it as respective extensions like .HTML, .py, .JSON, etc.

    C. Using the Tools

    You can download the GitHub files using GitHub Desktop. Open the link with the Github desktop. For this method, refer to the following steps:

    Open the file on the web browser

    Now, navigate to the file and select GitHub Desktop from the dropdown button

    It will open the file in the GitHub Desktop app and you can down the file or folder according to your choice.


    Download a Python file from GitHub

    The Python file download process is the same as ours for other files.

    • Open the py file
    • Select the Raw option so it will open the file in the Raw format page
    • later you can save the file in a .py file with CTRL+S (Win Users) and CMD+S (Mac users)

    Or simply copy the code and save it in notepad and save it with the python extension.


    How to download a folder from GitHub?

    If you want to download multiple files or an entire folder containing multiple files, you can use the following method.

    Download the Folder from GitHub using the Git Folder downloader

    Open the given link - DownGit

    Now, put your file or Folder link here in the textbox and click on the Download button

    GitHub folder downloader

    It creates a Zip file and a folder gets saved. By using the folder downloader, you can also download the specific file from GitHub.

    This method

    Download the folder from the GitHub command line

    I. You can also download GitHub folders and files by executing the Git command. 

    II. Open the GitHub on web browser

    III. then navigate to the file or folder that you wanted to download

    IV. Select Clone URL under the clone dropdown option

    V. Open git command line tool like Git Bash

    VI. Now enter the following commands

    cd <your Download location path>

    git clone <Link you've copied from github>

    It will download the folder or files into the selected download location.


    How to download files from GitHub on Android or iOS?

    The simplest way to download the files from GitHub on an android or iOS device is using the manual method which we are using for PC.

    • Open the GitHub file folder on Chrome web or Safari
    • Now open the website as desktop
    • then select the GitHub ZIP option to download the entire project

    After the project will get downloaded, you can use any zip opener to download the specific file.


    How to download CSV files from GitHub?

    Unlike other files, you can't save CSV files on your device directly. You may need some Python or R programming knowledge to download the CSV file.

    So, to download the CSV file we need to run some python scripts. Either on Python idle or jupyter and R Studio to run R scripts.

    But, how to read files from GitHub using python? What will be the script code? Just follow the given steps

    I. Open the file name and select the Raw option to open it as Raw

    II. Now, copy the path of the Raw content link

    III. And create a new file using the .py extension

    IV. Put the following code into the file

    Python Code to download files from GitHub

    import pandas as pd

    df = pd.read_csv("PUT THE GITHUB FILE LINK")

    df.to_csv("test.csv")

    R Code to download files from GitHub

    library (readr)

    urlfile="https://raw.githubusercontent.com/lrjoshi/webpage/master/public/post/c159s.csv"

    mydata<-read_csv(url(urlfile))

    V. Now, run the file and it will save the file into your PC

    This is how you can save the CSV file from GitHub within 5 mins.


    How to download the files and folders from GitHub on UBUNTU?

    To download the files and folders from GitHub on UBUNTU, you have plenty of ways. You can use GitHub command line interface, Web browser method, & GitHub desktop app. Steps will be same as we've demonstrated for PC users.


    Conclusion

    There are plenty of ways to download files or folders from GitHub. We've explained each of the methods to download the file and folder into your device.

    You can use the Manual method, Copy-paste method, GitHub Desktop method, or GitHub Files and folder downloader method to save it to your device.

    If you've any questions about this tutorial, please let us know through the comment section.

    Post a Comment

    0 Comments