Git's local repository and remote repository — confusing concepts

前端 未结 5 1525
甜味超标
甜味超标 2020-12-12 10:55

If I understand correctly, Git has two sorts of repositories: one called local, another called remote. My questions are extremely naive ones about the two types of repositor

5条回答
  •  春和景丽
    2020-12-12 11:07

    Your quoted statement is correct.

    You don't need to have a remote repository at all.
    You can have the full git experience, with commits, branches, merges, rebases, etc, with only a local repository.

    The purpose of a remote repository (eg, GitHub) is to publish your code to the world (or to some people) and allow them to read or write it.

    The remote repository is only involved when you git push your local commits to a remote repository, or when you git pull someone else's commits from it.

提交回复
热议问题