So far, most of the Git operations in this tutorial have happened entirely on your own computer. Commands such as git add, git commit, branch creation, and merging all work with your local repository by default.
In real development, however, code usually does not live on just one computer. Teams need a shared copy, and even personal projects often benefit from having an online version. This is where a remote repository comes in.
A remote repository is simply:
A Git repository stored on another server and accessed over a network.
In this tutorial, we will use GitHub to host our remote repositories.
A visual map makes the relationship clearer:
Your local repository is where you actually edit files and create commits. The GitHub repository stores an online copy that can be shared with other developers.
Local and Remote Repositories Are Different
This is an important distinction.
When you run:
git commit -m "Add login page"that commit is saved only in your local repository.
GitHub does not automatically know about it.
To upload the commit, you need to run:
git pushSo the workflow is:
Edit code → git add → git commit → saved locally → git push → uploaded to GitHub
This explains a common beginner situation: you create a commit, open GitHub, and do not see the latest change. Usually, the missing step is git push.
KNOWLEDGE QUIZ
What Is GitHub Used For?
At a basic level, GitHub is an online platform for hosting Git repositories. It helps you store code, share projects, and collaborate with other developers.
For example, a team may have a repository called:
company-web-appEach developer can clone it to their own computer, create branches, make changes, create commits, and then push those branches back to GitHub.
GitHub also provides features such as Pull Requests, Issues, code review, and CI/CD. Those collaboration features are covered later in the course.
What Is origin?
When you clone a repository from GitHub, Git normally gives the remote repository a default name:
originFor example:
git clone https://github.com/example/demo-project.gitAfter cloning, Git remembers the GitHub repository and usually refers to it as:
originThat is why you may later see a command such as:
git push origin mainThe word origin is not a special GitHub feature. It is simply the local name Git uses for that remote repository.
You can technically use other names, but origin is the standard default.
Practice
A classmate says, “I committed, so the team can definitely see it on GitHub.” Explain the problem using the concepts local repository, remote repository, and push.