Getting Started Git Basics Fetch, pull, and push

Fetch, pull, and push

Understand how fetch, pull, and push differ when exchanging changes between your local repository and a remote.

Fetch, pull, and push are the main actions Git uses to exchange changes between your local repository and a remote.

They sound similar, but they do different jobs. Understanding the difference is important because one action is read-only, one integrates remote work into your current branch, and one publishes your own commits.

Fetch

Fetch downloads new information from a remote repository, such as new commits or updated remote branches, but it does not change your current working files automatically.

Fetch is useful when you want to see what changed on the remote before deciding what to do next.

After a fetch, you can:

  • Inspect the newly downloaded commits.
  • Compare your local branch to the remote branch.
  • Decide whether to merge, rebase, or wait.

Fetch is the safest way to update your view of the remote because it does not directly modify your current branch.

Pull

Pull brings remote changes into your current local branch.

In many setups, pull means:

  1. Fetch changes from the remote.
  2. Integrate those changes into your current branch.

That integration may happen as a merge or, in some setups, as a rebase.

Pull is convenient, but it has a bigger effect than fetch because it changes your current local branch and may also update your worktree.

Push

Push sends your local commits to a remote repository.

You usually push when you want to share your work with collaborators or back it up to a shared remote such as GitHub.

Push only sends commits that exist locally and are ready to publish. It does not automatically include uncommitted worktree changes.

A simple way to remember them

  • Fetch: "Download remote updates without changing my current branch."
  • Pull: "Bring remote updates into my current branch."
  • Push: "Send my local commits to the remote."

A common workflow

A typical collaboration flow looks like this:

  1. Fetch to see whether the remote has new work.
  2. Pull when you are ready to integrate those remote changes.
  3. Make local changes, stage them, and create commits.
  4. Push your commits to share them.

In practice, teams may use slightly different workflows, but the basic purpose of these three actions stays the same.

How this appears in GitComet

GitComet can show whether your branch is ahead of or behind its remote counterpart.

That helps you understand whether you likely need to:

  • Fetch to refresh remote information.
  • Pull to bring in upstream changes.
  • Push to publish your local commits.

Documentation

Search

move open Esc close

Browse the docs or start typing to filter results.