1. What is a Remote Repository?
A remote repository is a version of your project that’s hosted on the internet or network. It acts as a shared space where developers can push, pull, and collaborate on code together.
In NBKRIST projects, remote repositories ensure that student teams can access, review, and merge work efficiently.
2. Creating a Remote Repository (New)
On GitHub, you can create a new remote repository by clicking the “New” button,
naming your repository (e.g., nbkristrepo), and choosing its visibility (public or private).
This is the starting point for connecting your local work to the global GitHub network.
3. Adding a Remote Repository to Local
After creating a remote repository, connect it to your local Git project using the
git remote add origin command.
Example for NBKRIST students:
git remote add origin https://github.com/nbkriststudent/nbkristrepo.git
4. Pushing Local Repository to Remote
Once connected, push your local commits to the remote repository using the push command. This uploads your work to GitHub for others to view and collaborate.
git push -u origin main
5. Push Tags
Git tags are used to mark specific points in history, often for releases or milestones. To share them with your team, you can push tags to the remote repository.
git push origin --tags
6. Working on Remote Repository
Files can be created, edited, and committed locally before being pushed to the remote repository. This ensures all changes are validated before syncing with the remote version.
NBKRIST developers practice disciplined workflows — commit locally, then push remotely for safety and traceability.
7. Fetch Command
The git fetch command downloads updates from the remote repository without merging them.
It helps you stay informed about what others have committed.
git fetch origin
8. Pull Command
The git pull command combines fetching and merging.
It updates your local branch with the latest commits from the remote repository.
git pull origin main
9. Git Local Repo to GitHub Remote Repo Integration
Integrating your local repository with GitHub ensures a seamless workflow between local development and remote collaboration. This connection enables developers to push, pull, and manage versions easily.
NBKRIST encourages students to practice this integration as part of their DevOps learning process.
git remote add origin https://github.com/nbkriststudent/nbkristrepo.git
git branch -M main
git push -u origin main