Working with Remotes
A remote is a version of your repository hosted elsewhere (GitHub, GitLab, a server).
Clone an existing repository
git clone https://github.com/user/repo.git
git clone https://github.com/user/repo.git my-folder
Connect a local repo to a remote
git remote add origin https://github.com/user/repo.git
git remote -v # List configured remotes
Send commits to the remote
git push origin main
git push -u origin main # -u remembers this pairing for future plain `git push`
Fetch and merge from the remote
git pull origin main # fetch + merge in one step
git fetch origin # Just download, don't merge yet
Typical daily workflow
git pull # Get latest changes
# ...make edits...
git add .
git commit -m "Add feature X"
git push