Skip to content

neo adopt

Take over a local checkout: create, push everything, become origin.

Shortcut for neo repo adopt. Creates the repo if missing, pushes refs/heads/* and refs/tags/* by URL (never forced), then makes neosource this checkout’s origin and demotes the old one to a second remote (default github). The old URL is never deleted and branches that tracked origin keep tracking it.

The adopted repo carries NO upstream-relationship record: neosource does not track it as imported from anywhere, and nothing syncs back unless you pass --mirror-back.

neo adopt [OPTIONS]
Option Value Required Default Env Values Description
--to <TO> no <owner>/<name> on neosource. Inferred when omitted: owner = your handle, name = the GitHub origin’s repo name, else the work-tree directory name
--visibility <VISIBILITY> no private public, internal, private Visibility applied ONLY when the repo has to be created. Defaults to private — adopt takes over an existing checkout, so the safe default is not to publish it
--old-remote <OLD_REMOTE> no github Name the current origin is renamed to. Refuses if a remote by that name already exists with a different URL — the old URL is never lost
--mirror-back no Also register a push mirror from neosource back to the GitHub repo origin pointed at, so the old home keeps receiving updates. Requires a linked GitHub account with the admin:public_key scope; a missing scope prints the elevation URL and is not fatal
--dry-run no Print the plan and exit, changing nothing. One read-only existence probe against the server is all it sends: nothing is created, pushed or rewritten
--yes no Accept a non-public target host (localhost, a private IP, .internal) without naming it via --host. Debug builds default to the local dev stack and NEOSOURCE_API is set in every dev worktree, so adopt refuses to repoint origin there unless you say so
--force no Proceed past the safety refusals: an origin already on this forge but pointing at a different repo, and a target repo that shares no history with this checkout