Remote Repos: push pull clone
Connect a local repo to GitHub, push commits to the remote, pull changes from teammates, and clone existing repositories.
Remote Repos: push pull clone is a free Frontend Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Frontend Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What Is a Remote?
A remote is a version of your repository hosted on the internet (GitHub, GitLab, Bitbucket). You collaborate with teammates by pushing your commits to the remote and pulling their commits from it.
git clone — Copy a Remote Repo
git clone url creates a local copy of the remote repository, including all history and branches. The remote is automatically added as origin.
git clone https://github.com/user/repo.git
git clone git@github.com:user/repo.git # SSHgit remote — Manage Remotes
git remote -v lists configured remotes. git remote add name url adds a remote. Convention: the primary remote is named origin.
git remote -v
# origin git@github.com:user/repo.git (fetch)
# origin git@github.com:user/repo.git (push)
git remote add origin https://github.com/user/repo.gitgit push — Send Commits to Remote
git push origin branchname uploads local commits to the remote branch. The first push of a new branch requires setting the upstream tracking with -u.
git push origin main
git push -u origin feature/auth # set upstream and push
git push # push to tracked remote (after -u)git pull — Receive Commits from Remote
git pull fetches changes from the tracked remote branch and merges them into your current branch. It's equivalent to git fetch + git merge.
git pull # fetch and merge from tracked upstream
git pull origin main # explicit remote and branchgit fetch — Download Without Merging
git fetch downloads all remote changes without modifying your working directory. Use it to see what teammates have committed before deciding how to integrate.
git fetch origin
git log origin/main --oneline # inspect remote commits
git merge origin/main # integrate when readySetting Up SSH Keys
GitHub requires authentication. HTTPS uses username + token. SSH keys are more convenient: generate a key pair, add the public key to GitHub, and authenticate automatically.
ssh-keygen -t ed25519 -C "your@email.com"
# Public key:
cat ~/.ssh/id_ed25519.pub
# Copy this into GitHub Settings → SSH KeysUpstream vs Origin
origin is your fork. upstream is the original repository. When contributing to open source: fork → clone → add upstream remote → pull from upstream to stay current.
git remote add upstream https://github.com/original/repo.git
git fetch upstream
git merge upstream/mainForce Push — Use With Extreme Caution
git push --force overwrites the remote branch's history. Never force-push to main or shared branches — it rewrites history for everyone. Safe for rebased personal feature branches before a PR is reviewed.
git pull --rebase
git pull --rebase applies your local commits on top of the fetched commits instead of creating a merge commit. Produces a cleaner, linear history. Many teams set this as the default pull strategy.
git pull --rebase origin main
# Set as default:
git config --global pull.rebase true.git/config
Local git configuration for the repository lives in .git/config. It stores remote URLs and tracking branches. ~/.gitconfig stores global settings like your name and email.
# ~/.gitconfig
[user]
name = Alice Developer
email = alice@example.com
[core]
editor = code --waitQuick Check
What does git push -u origin feature/auth do?
Recap: Remote Repositories
git clone copies a remote repo locally. git remote manages remote URLs. git push sends commits. git pull fetches and merges. git fetch downloads without merging. Use SSH for secure authentication. origin is your remote; upstream is the original in open source. Force push only on personal unreviewed branches.
Frequently asked questions
Is the “Remote Repos: push pull clone” lesson free?
Yes — the full text of “Remote Repos: push pull clone” is free to read here on the web, and the Frontend Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Frontend Academy course, upgrade to CoddyKit PRO.
What will I learn in “Remote Repos: push pull clone”?
Connect a local repo to GitHub, push commits to the remote, pull changes from teammates, and clone existing repositories. You practise Frontend Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Frontend Academy?
No prior experience is required. Frontend Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Remote Repos: push pull clone” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Frontend Academy lesson?
Yes. Every Frontend Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- git init add commit and status
- Branching: branch checkout merge
- Remote Repos: push pull clone
- Pull Request Workflow on GitHub