Push, Pull And Clone
Part of the Version Control section of Coddy's Terminal journey — lesson 48 of 58.
Three commands move work between your local repo and a remote:
git clone <url>: download a complete copy of an existing remote repo, including its full history. This is how you start working on someone else's project.
git push <remote> <branch>: upload your local commits on the named branch to the remote.git pull <remote> <branch>: download new commits from the remote and merge them into your current branch. It is shorthand forgit fetchfollowed bygit merge.
The first time you push a new branch, you usually pass -u (or --set-upstream) to remember the link:
git push -u origin feature-loginAfter that, plain git push and git pull use the saved upstream automatically.
You will not run any of these against a real server in this course, but you will recognize them everywhere in real-world tutorials.
Cheat sheet
Remote sync commands:
git clone <url>– download a complete copy of a remote repogit push <remote> <branch>– upload local commits to the remotegit pull <remote> <branch>– download and merge remote commits (shorthand forgit fetch+git merge)
Use -u on first push to save the upstream link for future git push/git pull calls:
git push -u origin feature-loginTry it yourself
This lesson doesn't include a code challenge.
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Version Control
2Getting Started
Initialize A RepositoryThe .git FolderConfigure Your IdentityGit StatusRecap - First Repo8Merging
What Is A MergeFast-Forward MergeThree-Way MergeMerge ConflictsResolve A ConflictRecap - Merge Master11Feature Branch Project
Project OverviewInitialize Main3Tracking Changes
The Staging AreaGit AddGit CommitModifying A Tracked FileGit LogRecap - First Commits6Recipe Site Project
Project OverviewInitialize And Ignore