4 votes. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. In this example a clone of is made and only the most recent commit is included in the new cloned Repo. 当项目过大时,git clone时会出现error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out的问题,如下图 Understanding Git Shallow Clone and Clone Depth Git Shallow Clone and Size. You can locally check out shallow cloning with your own repository. git clone --depth=1时的一些问题. git clone -depth=1 . 2 answers. "Clone depth" is a feature of git to reduce server load: Instead of cloning the complete repository (as usually done with git), using clone depth just clones the last clone-depth-number revisions of your repository. Clone the repository located at and only clone the. $ git clone --depth=2 --single-branch --branch master https://github.com/nmap/nmap.git. Provide an argument of -- depth 1 to the git clone command to copy only the latest revision of a repo: git clone -–depth [depth] [remote-url] You can also use git shallow clone to access a single branch: git clone [remote-url] --branch [name] --single-branch [folder] With git shallow clone you get fewer files.

How to Execute Git Shallow Clone. After the clone, a plain git fetch without arguments will update all the remote-tracking branches, and a git pull without arguments will in addition merge the remote master branch into the current master branch, if any (this is untrue when "--single-branch" is given; see below). history of commits specified by the option depth=1. Johannes_Kilian Feb 08, 2017. In literature this is also called " shallow clone ". In this example, we will use --depth option and provide the number of depth which is 2 in this case. Sign up IPython and Jupyter in-depth Tutorial, first presented at PyCon 2012 Let’s take a look at the popular Git repository for Django. ... Cloning into 'django' ... Git Shallow Clone and History. Shallow Clone or Specify Depth. In some cases, this may create problems like disk space or network bandwidth.