Remotes and Collaboration
~250 words ยท 2 min read
What is a remote?
A remote is a copy of your repository hosted somewhere else โ usually GitHub, GitLab, or a private server. The default remote is conventionally named origin.
Cloning
git clone https://github.com/user/project.git
This downloads the full history, creates a local repository, and automatically sets up origin pointing at the URL you cloned from.
Push and pull
git push origin main # upload your commits
git pull origin main # download + merge others' commits
Push sends your local commits to the remote. Pull fetches remote commits and merges them into your current branch.
The daily loop
git pullโ get the latest from your team.- Work on a feature branch.
- Commit your changes.
git pushโ share your branch.- Open a Pull Request for review.
- Merge after approval.
Always pull before you push. If the remote has commits you don't, Git will reject your push until you integrate them.