Remote
Add a remote repository
Section titled “Add a remote repository”git remote add origin https://github.com/user/project.git
Push commits
Section titled “Push commits”git push origin main
Pull updates
Section titled “Pull updates”git pull origin main
Fetch without merging
Section titled “Fetch without merging”git fetch
Best practices
Section titled “Best practices”- Always pull (
git pull
) before pushing (git push
). - Check
git remote -v
to list remote repositories.