File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,27 @@ git clone https://github.com/rust-lang/rust.git
2424cd rust
2525```
2626
27+ ### Shallow clone the repository
28+
29+ Due to the size of the repository, cloning on a slower internet connection can take a long time.
30+ To sidestep this, you can use the ` --depth N ` option with the ` git clone ` command.
31+ This instructs ` git ` to perform a "shallow clone", cloning the repository but truncating it to the last ` N ` commits.
32+
33+ Passing ` --depth 1 ` tells ` git ` to clone the repository but truncate the history to the latest commit
34+ that is on the ` master ` branch, which is usually fine for browsing the source code or building the compiler.
35+
36+ ``` bash
37+ git clone --depth 1 https://github.com/rust-lang/rust.git
38+ cd rust
39+ ```
40+
41+ > ** NOTE** : A shallow clone limits which ` git ` commands can be run.
42+ > If you intend to work on and contribute to the compiler, it is
43+ > generally recommended to fully clone the repository [ as shown above] ( #get-the-source-code ) .
44+ >
45+ > For example, ` git bisect ` and ` git blame ` require access to the commit history,
46+ > so they don't work if the repository was cloned with ` --depth 1 ` .
47+
2748## What is ` x.py ` ?
2849
2950` x.py ` is the build tool for the ` rust ` repository. It can build docs, run tests, and compile the
You can’t perform that action at this time.
0 commit comments