Git
See your app's history, commit changes, go back to an earlier version, and push to GitHub or another git host.
See your app's history, commit changes, go back to an earlier version, and push to GitHub or another git host.
Every project is a git repository. The agent commits everything after each turn, with your message as the commit message (see Your code is saved after every turn). Tools → Git shows that history and lets you work with it without the Shell.
The history lists the project’s commits, newest first, with who made each one (the agent’s turns are marked Agent), how long ago, and its short id. The note under it shows when the history was last backed up outside the sandbox.
Search the history with the box next to History: it looks through every commit’s message and author (type agent for the agent’s turns), or finds a commit by its id. Show more lists older commits, 50 at a time.
Click a commit to see its full message, author and email, the exact date and time, and its full id (with a copy button), plus the files it changed with the lines added and removed. Click a file to see its diff: added lines in green, removed in red. Click the commit again to close it.
Open the ⋮ menu on a commit and choose Restore this version. Every file goes back to how it was at that commit, and the app restarts.
A restore is saved as a new commit, so nothing is lost: to undo it, restore the version before it the same way. Any uncommitted changes are committed first, as Changes before restoring ….
Changes you make in the Shell or the Files panel, or that the agent made before you stopped it, show up under Commit with their state: M modified, A added, D deleted, R renamed, U new (untracked), ! conflicted.
Write a summary and click Commit all changes, or press ⌘/Ctrl+Enter. The commit is made as you. As with the agent’s commits, node_modules, vendor, .cache and .env files (except .env.example) are never committed.
To throw changes away, click the undo icon next to a file, or Discard all. Files go back to the last commit and new files are deleted. Ignored files like node_modules and .env are kept. This can’t be undone.
While the agent is working, committing, discarding, switching branches and restoring wait until it finishes.
The branch menu at the top shows the current branch. Pick another to switch to it, or choose New branch… to start one from the current commit. The app restarts on the new branch.
Connect a remote repository to push your commits to it and pull commits others made.
If your OneDrop has a GitHub App set up, click Connect to GitHub. A dialog walks you through it.
The first time, click Continue to GitHub. On GitHub, pick your account or an organization, choose all repositories or only the ones OneDrop may use, and approve. GitHub brings you back with the dialog open. If you end up back on the project without GitHub bringing you, open Tools → Git: the dialog asks Finished installing on GitHub? Click Continue to pick up the installation.
Then pick an owner (your account or an organization) at the top of the dialog, and either:
The name is suggested from your project, and OneDrop checks as you type that it’s free. Choose Private or Public.
The dialog opens on New repository when your project has commits, and on Existing repository when it doesn’t. Add account or organization installs the app somewhere else.
You only see repositories that both you and the app can reach. No token is stored for the project: OneDrop gets a short-lived one from GitHub each time it pushes or pulls. If your GitHub sign-in expires, the dialog asks you to reconnect.
Without the GitHub App, or for another git host (Other git host), connect with an access token:
repo scope).Push sends the current branch to the remote. Pull brings in commits the remote has that the project doesn’t. Both run in the background; the card shows Pushing… or Pulling…, then how many commits there are to push or pull.
The token is stored encrypted by OneDrop and never shown again. It never goes into the sandbox: pushes and pulls run on OneDrop’s server, which carries commits in and out of the sandbox. Remotes must use HTTPS, and on the public internet unless your admin allows private networks (see configuration).