Stage 6 · Lesson 1 of 8
Remotes: clone, fetch, pull and push
A remote is another copy of your , usually on . The default name for it is origin. git clone copies a repository to your machine and sets up for you.
git fetch downloads new commits but does not touch your files. git pull and then merges or those commits into your branch. git push uploads your commits.
origin/main is your local note of where main was on the remote the last time you fetched. The pull.rebase setting decides whether pull merges or rebases.
Common traprunning git pull on a branch with local changes without knowing whether it will merge or rebase, then being surprised by a conflict.
A question to check yourself, an AI practice session and 2 cheat sheet entries come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- BookFreePro Git
Scott Chacon and Ben Straub
Chapter 6 covers GitHub itself: forks, pull requests and maintaining a project
- GuideFreeContributing to a Project (GitHub Docs)
GitHub · Beginner
GitHub's own walkthrough of the fork, branch and pull request workflow
Practise
Keep handy
Also worth your time
A widely used commit message convention you will meet in many repositories
- roadmap.sh: Git and GitHubGo deeper
The GitHub half of the map: Actions, projects, security features and more