Files
Files
What: A remote repository is a version of your project hosted on a server (like GitHub or GitLab) that enables
multiple collaborators to work on the same project.
Why: Remote repositories are vital for sharing code, collaborating with team members, and serving as a backup.
They allow multiple people to contribute to a single project.
How:
o Add a remote repository: git remote add origin <repository-url>
o View remotes: git remote -v
o Remove a remote: git remote remove <name>
When to use:
o When you start working on a team project and need to push your work to a shared repository.
o When you want to contribute to an open-source project and track its progress.
Example:
1. You create a new repository on GitHub.
2. In your terminal, initialize your local Git repo:
git init
3. Add the remote repository:
git remote add origin https://github.com/username/repo-name.git