Code: your repository, any branch

Browse any branch of the project's repository, open and edit any file, and commit — from every device.


Code shows the project's repository as itself: any branch, its whole tree, any file, its history, and the difference between two branches. It works the way VS Code does, on the web, the desktop app, the Mac, an iPad, both phones and in the editor.

It appears in the project's navigation as soon as the project has a repository bound. On a phone it starts in More; an admin can move it into the bar in Settings → Navigation.

Browsing

  • The branch switcher lists the repository's default branch first, then the rest by their newest commit. Create branch… makes one from the branch you are on.
  • The explorer is a file tree with an icon for every common file type. Folders that hold only another folder show as one row, like src/main/kotlin. Type to filter it.
  • Go to file (⌘P on the web and the Mac, the search field on a phone) finds a file by a few letters of its name.
  • Search (⇧⌘F) finds text across the branch's files, with match case and regular expressions.
  • History lists the branch's commits, or one file's. A commit opens to the files it changed and their diffs. Compare sets two branches against each other the way a pull request does.

Pictures, PDFs, videos and ZIP archives open in the same viewer as a run's files. Markdown, HTML and SVG open as a preview with their source a click away. Files over 1 MB open read-only.

Editing, and committing

Change a file, add one, rename or delete one, make a folder. Saving keeps the change on your device; nothing has reached the repository yet. Changed files show the way VS Code shows them: M for modified, A for added, R for renamed, and a dot on the folders that hold them.

Changes lists everything you have changed on the branch, with a commit message ready and one Commit button: all of it, as one commit, straight to the branch. Each branch keeps its own changes, so switching branch loses nothing.

An admin can turn on Commit as you finish (Commit automatically in the Mac, iPhone, iPad and Android apps) in the project's settings. Then saving, adding, renaming or deleting commits at once.

Git keeps no empty folders, so a new folder lives on your device until a file goes in it.

When somebody else changed it too

Code merges your edit with whatever landed on the branch since you opened the file — silently, when you changed different lines. When you both changed the same lines it shows both versions and asks which to keep, exactly as the wiki does.

A branch that only takes changes through a pull request (a protected branch) refuses the commit. Code says so and offers Commit to a new branch, with your changes intact.

In the editor

In VS Code, Peractor: Open Branch… adds a branch to your workspace as a folder. VS Code's own explorer, editor, icons and Source Control view work on it: save a file and it appears under Source Control, with a commit box.

Code reads and commits through your organization's git access, the same one runs use. Checking a branch out onto a machine is not part of Code yet.