Documentation

Git and GitHub

Import a Git repository, keep pushing with Git, or mirror GitHub both ways.

Onset has its own model, and Git keeps working around it. A team can try Onset on one repository, use both for as long as it likes, or move over completely.

Import a repository

on import https://github.com/acme/shop --to upstream.codes/acme/shop
  • Each commit on the default branch's first-parent line becomes a version, with its message, author and time.
  • Tags on those commits become tags of their versions.
  • Every branch and tag is also copied to the project's Git view as it is.
  • Submodules come along as pointers to their commits.
  • Git LFS files come in as their pointer files. Onset stores big files itself, up to 5 GB each, so landing the real files replaces the pointers.

To make a repository that's already on Upstream an Onset project in place, import it onto itself. You need to be one of its admins:

on import upstream.codes/acme/shop --to upstream.codes/acme/shop

A repository's admins can also turn Onset on or off in its settings.

The Git view

Every project hosted on Upstream is also a Git repository:

git clone https://git.coline.app/acme/shop.git
  • Main is a Git branch. Each version lands there as a commit within seconds, and its message ends with Onset-Change and Onset-Version trailers.
  • Each release line is a branch of its name.
  • Private paths are left out of the Git view for everyone.
  • on git shows where the project clones from and whether the Git view is current.

Keep pushing with Git

People on Git keep pushing to main as usual. People and agents on Onset land. Both end up on the same main.

  • A push to Git main comes into Onset at the project's next on command or read. Each commit on main's first-parent line becomes a version.
  • If Onset landed something meanwhile, the Git commits merge into one version, and Git gets a merge commit joining both lines. Nobody's work is overwritten.

When the Git view pauses

The Git view pauses instead of overwriting anything when:

  • Git and Onset changed the same lines.
  • A commit touches a private path.
  • Someone force-pushed main.
  • A push adds over 32 MB at once.

on git says why. Bring the Git side in as a change, land it and resume:

on import https://git.coline.app/acme/shop.git --change main
on land -m "Bring in the commits from Git"
on git resume

Bring a branch in as a change

on import https://github.com/acme/shop --change fix-login
on land -m "Fix login"

Run it in a workspace. The branch becomes a change on top of the version it started from.

Keep GitHub

A team whose pull requests and CI live on GitHub, GitLab or its own Git server can land with Onset and keep that as it is:

on git mirror https://github.com/acme/shop
  • Every version of main becomes a commit on the repository's main, with the same message and author. --branch picks another branch.
  • A pull request merged there comes into Onset's main as a version, merged with whatever landed meanwhile.
  • It uses Git's own credentials. Run it on any machine with landing rights. It keeps going until stopped, or --once for a scheduled job.
  • If both sides changed the same lines, or the branch is force-pushed, it stops and says so.
  • A hosted project with private folders can't be mirrored.

Leave Git behind

on settings git=off stops copying main to Git. on settings git=on turns it back on and catches it up.

Git to Onset

GitOnset
git cloneon get
git status, git diff, git logon status, on diff, on log
git add, git commitNothing. It saves itself.
git commit -m and git pushon land -m
git pull, git rebase mainon sync
git checkout -bon new
git switch <branch>on switch <change>
git stashon new. The current change stays saved.
git restore <file>on restore <file>
git reflog, git reseton undo
git revert <commit>on undo <version>
git blame <file>on blame <file>
git show <rev>:<file>on show <file> --from <version>
git tag v1.0on tag v1.0
git worktree addon get <project> <folder>
git bisecton bisect <good> <bad> --run "<command>"
git cherry-pick onto a release branchon land <change> --to <line>
pre-commit hooks[land] run in onset.toml
a pull requeston land without landing rights, or on access <change> team