What is Git?

Git is a version control system that tracks changes to the files in your project.

Instead of treating your project as a collection of files that you simply overwrite whenever you make a change, Git records the history of those changes. This allows you to see what changed, create versions of your project, and return to an earlier state when necessary.

Git runs on your computer. It does not require GitHub or any other online service.

A Git repository is simply your project together with the information Git uses to track its history.

In this guide, Git will be used to:

  • track changes to the project
  • create commits that represent saved versions
  • create and switch between branches
  • prepare changes to be shared with GitHub

What is GitHub?

GitHub provides an online place to store Git repositories and collaborate on projects.

Your Git repository exists locally on your computer. A GitHub repository provides a remote copy that can be accessed from GitHub and used by other tools and developers.

Git and GitHub are therefore not the same thing. Git is the version control system, while GitHub is a service that hosts Git repositories and provides collaboration features around them.

GitHub will be used in this guide to:

  • store the remote repository
  • share branches and commits
  • create Pull Requests
  • review changes before they are merged
  • provide the repository that Cloudflare Pages will connect to

What is Cloudflare Pages?

Cloudflare Pages can connect to your GitHub repository and build and deploy your website.

Once connected, Cloudflare Pages can respond to changes in the repository by creating a deployment from the relevant branch or commit.

This means you do not need to manually upload the website files to the hosting service every time you make a change.

Cloudflare Pages will be used in this guide to:

  • connect the website project to GitHub
  • create deployments from Git branches
  • provide preview deployments for changes
  • deploy the approved version to production
  • connect the production deployment to a custom domain

How They Work Together

Your local project is where you write and test your website. Git tracks the changes you make to that project.

When your changes are ready to share, Git can send your commits to a repository on GitHub. GitHub then becomes the remote source of the project.

Cloudflare Pages connects to that GitHub repository. When a branch is pushed, Cloudflare Pages can build the project and create a deployment from it.

This creates a chain:

Local project
    ↓
   Git
    ↓
 GitHub
    ↓
Cloudflare Pages
    ↓
Deployment

Each tool has a different responsibility. Git manages the project’s history, GitHub provides the remote repository and collaboration workflow, and Cloudflare Pages handles the deployment of the project.

The Complete Workflow

The workflow used throughout this guide moves through five main stages:

01Local ProjectBuild and test the website on your computer.
02GitTrack changes and create versions of your project.
03GitHub

Store the Git repository remotely and collaborate on changes.

04Cloudflare PagesBuild and deploy the project from GitHub.
05Production WebsiteThe deployed website is available to visitors.

In later chapters, this basic flow becomes a more complete development workflow. You will create feature branches, push those branches to GitHub, review changes through Pull Requests, test Cloudflare preview deployments, merge approved changes into main, and deploy the updated project to production.

The important concept to understand at this stage is that a deployment is not a separate activity from development. It is the final part of a workflow that connects your local project, version history, remote repository, testing environment, and production website.

Support PageDeploy with a coffee