# Svn Checkout Directories only

```
project/
├── dir1
│   └── subdir1
│       ├── file1
│       ├── file2
│       └── file3
├── dir2
│   ├── subdir1
│   └── subdir2
└── dir3
    ├── subdir1
    │   ├── file1
    │   └── file2
    └── subdir2
```

## Checkout all directories only on the root of the repo

```
svn co --depth immediates http://svn.xxx.com/project .
```

This would checkout the empty directories `dir1`, `dir2`, `dir3`

### Get another level of the directories

```
svn up --set-depth immediates dir2
```

This would update all subdirectories under `dir2`, i.e. `dir2/subdir1` and `dir2/subdir2`

### Get all of the contents inside `dir3`

```
svn up --set-depth infinity dir3
```

This would update all subdirectories and files under `dir3` recursively

## List folder with depth

### List immediates folder

```
svn ls --depth immediates .
```

### List folder recursively

```
svn ls --depth infinity .
```

## Reference

* <http://svnbook.red-bean.com/en/1.7/svn.advanced.sparsedirs.html>
* <http://stackoverflow.com/a/50980/3869284>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ryanzzff.gitbook.io/til/svn/checkout-dir-only.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
