git clone first creates a new empty repository. (e.g. git init )
Then it sets the given repository as remote, called "origin". ( git remote add )
Then the main work is done by git fetch , which is the only team talking to other repositories. It transfers all the commits of the remote repository to the current repository and creates inside your repository branches, starting with "remote / origin /" corresponding to the branches in the remote repository.
If you have a non-bare repository by default, it will also call git checkout to check usually the main branch.
If you call git branch -r , it will show you the "remote" branches, i.e. the branches in your repository that will be updated using git fetch . (You never work on this directly.)
Whenever you want to work with a branch, you use git checkout , which will create a copy of this branch without the "remote / origin /" prefix. These are the "local" branches on which you work. ( git branch will show them.)
Almost everything you do will only include your local repository. The one exception is git push , which is the only command to update remote repositories, and git fetch , which is the only command to request other repositories.
git pull is just a combination of git fetch and git merge . The first selection modifies and updates remote / origin / *, and the second merges these changes into your local branch.
michas
source share