mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-03 18:30:32 +08:00
When using `rad init` the default branch for the project can be predetermined by inspecting the working copy repository. To improve the experience, it will first check `init.defaultBranch` in the Git configuration file. If it does not find this, it falls back to choosing the default head of the repository at the time. This may be HEAD, and in this case it will error and provide helpful information. The repository may also not have any default head at the time, and this also results in an error and hint.
502 B
502 B
If you try to init from a directory that doesn't contain a Git repository,
it will fail:
$ rad init
✗ Error: a Git repository was not found at the given path
Ok so let's initialize one.
$ git init -q
Now we try again.
$ rad init
✗ Error: could not determine default branch in repository
✗ Hint: perhaps you need to create a branch?
✗ Error: aborting `rad init`
Looks like we need to get to work and start working on a branch and add commits to it.