git中的origin

  • 首先假设你自己在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的指针
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。