Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init: add subdir description
Browse files Browse the repository at this point in the history
pared committed Feb 25, 2020

Verified

This commit was signed with the committer’s verified signature.
fiji-flo Florian Dieminger
1 parent 569e53d commit ea26f35
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions public/static/docs/command-reference/init.md
Original file line number Diff line number Diff line change
@@ -3,12 +3,12 @@
This command initializes a <abbr>DVC project</abbr> on a directory.

Note that by default the current working directory is expected to contain a Git
repository, unless the `--no-scm` option is used.
repository, unless the `--no-scm` or `--subdir` option is used.

## Synopsis

```usage
usage: dvc init [-h] [-q | -v] [--no-scm] [-f]
usage: dvc init [-h] [-q | -v] [--no-scm] [-f] [--subdir]
```

## Description
@@ -30,6 +30,9 @@ local cache and you cannot `git push` it.
- `--no-scm` - skip Git specific initialization, `.dvc/.gitignore` will not be
written.

- `--subdir` - initialize <abbr>DVC repository</abbr> in current directory and
allow to search for Git repository in parent directories

- `-f`, `--force` - remove `.dvc/` if it exists before initialization. Will
remove any existing local cache. Useful when a previous `dvc init` has been
corrupted.
@@ -67,3 +70,28 @@ $ cat .dvc/.gitignore
...
/cache
```

Create a new <abbr>DVC repository</abbr> in a subdirectory of Git repository:

```dvc
$ mkdir repo && cd repo
$ git init
$ mkdir subrepo && cd subrepo
$ dvc init --subdir
```

In this case, Git repository is inside `repo` directory, while <abbr>DVC
repository</abbr> is inside `repo/subrepo`.

```dvc
$ tree repo -a
repo
β”œβ”€β”€ .git
.
.
.
└── subrepo
└── .dvc
```

0 comments on commit ea26f35

Please sign in to comment.