Commit and sync

There are two ways to commit:

  • From a changelist: commits exactly the hunks of that changelist. See Changelists.
  • From the commit box: commits the staged files, as on the command line.

This topic describes the commit box and the exchange with the remote.

Stage files

In the changelist panel, each file row starts with a checkbox. Select it to stage the file, clear it to unstage the file.

In the commit box, Stage all and Unstage all stage or unstage every changed file.

Commit staged files

  1. Stage the files.
  2. In the commit box, enter the message. The field shows how many files are staged.
  3. Click Commit.

Amend the last commit

  1. Select Amend (extend last commit).
  2. Edit the message if needed.
  3. Click Amend commit.

The staged changes are added to the last commit. Do not amend a commit that is already pushed, unless you intend to force-push.

Fetch, pull and push

The commit box has three buttons for the remote, shown as icons:

ButtonAction
FetchFetches from the remote (git fetch --prune). Remote branches deleted on the server are removed locally. The working tree stays unchanged.
PullPulls the current branch from its upstream, fast-forward only (git pull --ff-only). If local and remote have diverged, the pull fails.
PushPushes the current branch.

If the repository has more than one remote, a selector next to Push sets the push target.

To pull with rebase, use Pull (rebase) in the branch context menu of the history. See Branches and tags.

After a push

After you push a branch, a notification offers to open a pull request for it. Click Create PR to open the pull request dialog, or Not now to dismiss the notification.

Push up to a specific commit

You can push only part of your local commits. In the history, right-click an unpublished commit and choose Publish through here. Tracemoor pushes the oldest unpublished commit up to and including this one. Later commits stay local.

Force push

  1. In the history, right-click the branch and choose Force push (with lease)….
  2. The dialog lists the commits under Will land on remote and Will be discarded on remote. If nothing would be discarded, a regular push is enough.
  3. Click Force push.

Tracemoor uses --force-with-lease. The push fails if the remote branch has changed since your last fetch.