Files
Sekhat Temporus 37ea81766e cli: improve default branch pick
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.
2025-07-23 07:43:27 +01:00

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.