Fastest way to download a GitHub project

前端 未结 8 1340
醉话见心
醉话见心 2020-12-22 17:14

I need to download the source code of the project Spring data graph example into my box. It has public read-only access. Is there is an extremely fast way of downloading thi

相关标签:
8条回答
  • 2020-12-22 17:30

    You say:

    To me if a source repository is available for public it should take less than 10 seconds to have that code in my filesystem.

    And of course, if you want to use Git (which GitHub is all about), then what you do to get the code onto your system is called "cloning the repository".

    It's a single Git invocation on the command line, and it will give you the code just as seen when you browse the repository on the web (when getting a ZIP archive, you will need to unpack it and so on, it's not always directly browsable). For the repository you mention, you would do:

    $ git clone git://github.com/SpringSource/spring-data-graph-examples.git
    

    The git:-type URL is the one from the page you linked to. On my system just now, running the above command took 3.2 seconds. Of course, unlike ZIP, the time to clone a repository will increase when the repository's history grows. There are options for that, but let's keep this simple.

    I'm just saying: You sound very frustrated when a large part of the problem is your reluctance to actually use Git.

    0 讨论(0)
  • 2020-12-22 17:30

    Another faster way of downloading a GitHub project would be to use the clone functionality with the --depth argument as:

    git clone --depth=1 git@github.com:organization/your-repo.git
    

    to perform a shallow clone.

    0 讨论(0)
  • 2020-12-22 17:31

    When you are on a project page, you can press the 'Download ZIP' button which is located under the "Clone or Download" drop down:

    This allows you to download the most recent version of the code as a zip archive.

    If you aren't seeing that button, it is likely because you aren't on the main project page. To get there, click on the left-most tab labeled "<> Code".

    0 讨论(0)
  • 2020-12-22 17:33

    Use

    git clone https://github.com/<path>/repository
    or
    git clone https://github.com/<path>/<master>.git
    

    examples

    git clone https://github.com/spring-projects/spring-data-graph-examples
    git clone https://github.com/spring-projects/spring-data-graph-examples.git
    
    0 讨论(0)
  • 2020-12-22 17:47

    There is a new (sometime pre April 2013) option on the site that says "Clone in Windows".

    This works very nicely if you already have the Windows GitHub Client as mentioned by @Tommy in his answer on this related question (How to download source in ZIP format from GitHub?).

    0 讨论(0)
  • 2020-12-22 17:48

    Downloading with Git using Windows CMD from a GitHub project

    You can get download the link from GitHub <b>HTTPS clone URL</b>

    Download with Window Command Prompt cmd for above picture HTTPS clone URL

    1. Copy the HTTPS clone URL shown in picture 1

    2. Open CMD

    3. git clone //paste the URL show in picture 2

    0 讨论(0)
提交回复
热议问题