A Git commit starts in your local history. The remote is where you share it with your team, and fetch, pull, and push control how changes move between the two repositories.

Local Repository

Local means the Git repository on your computer.

This is what you are directly working with in SmartGit.

You can commit, branch, squash, rebase, and inspect history locally without immediately changing the server.

Remote Repository

A remote is another copy of the repository, usually hosted on a server such as GitHub, GitLab, Bitbucket, or an internal Git server.

The conventional name for the primary remote is:

origin

So:

main

usually means your local branch.

While:

origin/main

represents your local reference to the state of main on the remote the last time Git fetched it.

Important: origin/main is not the server itself. It is your locally stored knowledge of the remote branch.

Fetch

Fetch asks the remote:

What’s new?

Git downloads information about new commits and updates remote-tracking branches such as:

  • origin/main
  • origin/develop
  • origin/feature/blog-page

But it does not integrate those changes into your current local branch.

That’s the important part:

Fetch = update my information, don’t change my work.

Pull

Pull means:

Get remote changes and integrate them into my current branch.

Conceptually, a pull is usually:

Fetch + Merge

or, depending on configuration:

Fetch + Rebase

That’s why Pull and Fetch are not the same thing.

Push

Push sends your local commits to a remote repository.

Local                         Remote

feature/blog-page   ---->   origin/feature/blog-page

A commit therefore doesn’t automatically exist on GitHub, GitLab, etc. just because you’ve created it locally.

Force Push

Normally, Git protects remote history from being overwritten.

But operations such as:

  • Rebase
  • Squash
  • Edit Author
  • Amend

can rewrite commits that have already been pushed.

Your local history might then look like:

A -- B -- C' -- D'

while the remote still has:

A -- B -- C -- D

A normal push cannot simply fast-forward from one to the other.

That’s where a Force Push may be required.

Important

Force Push means:

Replace the remote branch history with my rewritten local history.

This can be perfectly legitimate on your own feature branch.

It can also be dangerous on a shared branch.

Rule of thumb: Know who else is using the branch before rewriting and force-pushing it.

Fast-Forward

A fast-forward is the simple case where Git only has to move a branch pointer forward.

Before:

A -- B -- C
     ↑    ↑
   main feature

After:

A -- B -- C
          ↑
     main + feature

No histories have to be combined.

This is why Git likes fast-forward updates: they’re simple and don’t rewrite existing history.