Skip to content

Your first commit

This page walks through one change from edit to push. You don’t need to refresh anything along the way: tt-git notices when files change and updates itself.

Edit a file in your repository with your usual editor and save it. In a moment it appears in the status pane with M (modified, not staged) in red. A new file shows ?? (untracked).

The status pane with its title and each kind of file status code called out
  1. Press 2 to focus the status pane.

  2. Move to the file with j and k. Its diff shows in the details pane if details is open.

  3. Press space to stage it. The code turns to M in green: staged, nothing left unstaged.

a stages every file at once. Press space on a staged file to unstage it.

To stage only part of a file, press enter on it instead and pick the hunks or lines you want. See Staging hunks and lines.

The status pane after staging package.json, its code now green on the left
  1. Press c. A Commit message box opens.

  2. Type the message and press enter. esc cancels.

The Commit message dialog over the screen with a message typed

The help bar shows ✓ commit, the file leaves the status list, and the graph jumps to your new commit. The status title now shows ↑1: one commit your upstream doesn’t have.

Press P (shift+p) from any pane. tt-git runs git push, and the ↑1 goes away when it’s done.

If the branch has never been pushed, tt-git pushes it to origin (or to the first remote, if there’s no origin) and sets it as the upstream, like git push -u origin HEAD.

Press p to pull. See Push, pull and fetch for details.