6.3 Connecting Local and Remote Repositories
You can link an existing local Git repository to a remote service like GitHub, GitLab, or Codeberg.
Connecting a Local Repository
-
Create a remote repository on your hosting platform.
-
Copy its URL.
-
Link and push your local repo:
git remote add origin https://example.com/username/my-first-repo.git
git branch -M main
git push -u origin main
Pulling Updates from Remote
git pull origin main
Regularly pull updates to stay in sync with your teammates.