Linux, terminal and Git

Stage 6 · Lesson 1 of 8

Remotes: clone, fetch, pull and push

GitHub and working with others

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

  • BookFree
    Pro Git

    Scott Chacon and Ben Straub

    Chapter 6 covers GitHub itself: forks, pull requests and maintaining a project

  • GuideFree
    Contributing to a Project (GitHub Docs)

    GitHub · Beginner

    GitHub's own walkthrough of the fork, branch and pull request workflow

Practise

  • A safe repository built for making your first pull request to someone else's project

Keep handy

Also worth your time

Mark this stage as not done?