-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3881891
commit 88956cf
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## depth的作用 | ||
> --depth <depth> | ||
Create a shallow clone with a history truncated to the specified number of commits. Implies --single-branch unless --no-single-branch is given to fetch the histories near the tips of all | ||
branches. If you want to clone submodules shallowly, also pass --shallow-submodules. | ||
|
||
|
||
每一个commit都是一个版本快照,都占据存储空间。 | ||
|
||
git clone --depth=1或者git pull --depth=1只会拉取最近的一个commit,当depth=3时,则拉取最近的3个commit。 | ||
这样在ci或者自动化环节特别有用,能减少拉取的时间和git占据的储存空间。 | ||
|
||
不指定depth的话,默认是拉取所有commit |