Files
heartwood/crates/radicle-cli/examples/rad-init-existing.md
T
Lorenz Leutgeb 5bc2dc677b repo: Move workspace crates into crates subdirectory
This keeps the top level of the repo cleaner, e.g.
<https://github.com/radicle-dev/heartwood> scrolls less and
<https://app.radicle.xyz/nodes/rosa.radicle.xyz/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5/>
might show more files at the top level.

This way we also don't have to explicitly name all crates in
`Cargo.toml`.
2025-06-09 15:09:21 +02:00

1.1 KiB

Let's clone a regular repository via plain Git:

$ git clone $URL heartwood
$ cd heartwood
$ git rev-parse HEAD
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354

We can see it's not a Radicle working copy:

$ rad .
✗ Error: Current directory is not a Radicle repository

Let's pick an existing repository:

$ rad inspect rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji

And initialize this working copy as that existing repository:

$ rad init --existing rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
✓ Initialized existing repository rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji in [..]/heartwood/..

We can confirm that the working copy is initialized:

$ rad .
rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
$ git remote show rad
* remote rad
  Fetch URL: rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji
  Push  URL: rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
  HEAD branch: (unknown)
  Remote branch:
    master new (next fetch will store in remotes/rad)
  Local ref configured for 'git push':
    master pushes to master (up to date)