- 首先假设你自己在github上创建了一个Repository,叫做myRepository,假设你的Github ID是user1,这个时候指向你的代码库的链接是
https://github.com/user1/myRepository
- clone
git clone https://github.com/user1/myRepository
这个时候git就在本地拷贝一份托管在github上的代码库
- 进入
cd myRepository
git remote -v
你会看到控制台输出
origin https://github.com/user1/myRepository.git (fetch)
origin https://github.com/user1/myRepository.git (push)
也就是说git为你默认创建了一个指向远端代码库的origin(因为你是从这个地址clone下来的)
- git的服务器端(remote)端包含多个repository,每个repository可以理解为一个项目。而每个repository下有多个branch。"origin"就是指向某一个repository的指针