Skip to content
Download

Fetch, pull and push

Commitline keeps your branch in step with its remote branch, its upstream, through your own Git: your credentials, your SSH keys and your hooks.
The status bar shows how far apart they are, such as main ↑2 ↓1: 2 commits to push and 1 to pull.

Fetch

Fetching brings in what's new on the remote without changing your files or your branch.

  • Fetch, on History's toolbar, fetches your branch's remote.
  • Fetch all, at the top of the Repository view, fetches every remote of the repository.
  • Fetch all, on the Dashboard, fetches every repository it lists, four at a time.

History's toolbar: Undo commit, Fetch, Pull, Push, Branch, Stash and TerminalHistory's toolbar: Undo commit, Fetch, Pull, Push, Branch, Stash and Terminal

The status bar then says Fetched just now, and later Fetched 5 minutes ago.

Pull

Pull, on History's toolbar, fetches, then moves your branch forward to its upstream.
It only ever fast-forwards: it never makes a merge commit and never rebases.
Changes you haven't committed stay, unless the pull would overwrite one: then Git doesn't pull, and Commitline names the files.
Commit or stash them first.

Its tooltip names the repository's hooks a pull will run.

When your branch and its upstream have both moved, a pull can't fast-forward, and Commitline says so.
Merge or rebase your branch: in History, drag the upstream's chip onto your branch's chip.
See Merge, cherry-pick and revert.

Push

Push, on History's toolbar, sends your branch to the branch of the same name on its remote.
It reads Push 2 when you have 2 commits to push.

  • A branch with no upstream yet is published: Commitline pushes it and sets the new remote branch as its upstream.
  • A push is never forced, and sends no tags.
  • When the upstream has commits you don't have yet, Commitline says so: pull first, then push.

Commit and push, in the Git view, commits and pushes in one go; see Changes and commits.

Force push

After you rewrite commits you've already pushed, such as with a rebase, a push is refused, since the upstream has commits your branch doesn't.
Commitline then offers Force push… with the refusal.

It asks Force push with lease? and names the commit the upstream was on at your last fetch.
The force push replaces the upstream's commits with yours only while the upstream is still on that commit: if anyone pushed since, the remote refuses it and nothing changes.

When the remote itself refused a push, Commitline offers Fetch, so you can see what's there.

What can't be taken back

A fetch, a push and a force push can't be undone, since they change the remote, not just your computer.
A pull can: Ctrl+Z (⌘Z on a Mac) puts your branch back where it was.
See Undo.

When Git needs your credentials

Commitline runs Git without a terminal, so it can't type a password for you.

  • For HTTPS, set up a credential helper, such as Git Credential Manager.
  • For SSH, add your key to the server and to ssh-agent, and connect once from a terminal so Git knows the server's host key.

Commitline says which one it needs; see Troubleshooting.