Git & GitHub Mastery: Workflows & CI/CD
Back to Git Fundamentals

Remotes — Push, Pull, Fetch

Working with remote repositories. The push/pull/fetch model, tracking branches, and origin vs upstream. FIND_VIDEO: search 'git remote push pull fetch tutorial' — recommended channel: Atlassian Bitbucket / GitHub Docs. Aim for 10 min or under.

9 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Remote Tracking Concept — Remote Tracking Branches are introduced as local pointers mirroring the remote state.
  2. Investigating Configuration — Commands are demonstrated to verify remote configuration and branch tracking status.
  3. Pushing Local Changes — The process of committing locally and then pushing those changes to the remote is shown.
  4. Fetching Remote Updates — `git fetch` downloads remote changes and updates the local remote tracking branch.
  5. Merging Fetched Data — The necessary `git merge` command integrates the fetched remote changes into the local working branch.
  6. Verification Commands — Review of verification commands like `git status` and `git branch -vv` to confirm synchronization.
PDF notes

Frequently asked questions

What does 'diverged' mean in Git status?

It means both the local branch and the remote branch have new, unique commits since the last synchronization point, requiring a merge or rebase.

Why use fetch and merge instead of just pull?

Fetch gives you control to inspect incoming changes using `git log` before integrating them with `merge`, preventing accidental integration of breaking changes.

How do I set up tracking for a new feature branch?

The first time you push the new branch, use the `-u` flag (e.g., `git push -u origin feature-x`) to establish the tracking relationship.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.