search

Home  >  Q&A  >  body text

A few questions about Git

Recently doing an internship and working on a front-end project. Everyone in the team has a complete version library, but the addresses that everyone clones remotely at the beginning are different (for example, I am aaa@X.com and my colleague is bbb@X .com, ccc@X.com, etc.), then, when everyone makes their own modifications and then pushes it to the remote, doesn't it only push to their own remote library? But why can I pull down other people's modifications as if our remote library is the same?

我想大声告诉你我想大声告诉你2794 days ago587

reply all(1)I'll reply

  • 滿天的星座

    滿天的星座2017-05-02 09:34:12

    You said that the repository that everyone clones at the beginning should be fork来自同一仓库的,就是说有一个公共仓库 sss,你说的aaa, bbb, ccc都是fork来自sss的仓库,然后每个人修改了在推送自然是往各自的仓库推送的,但是aaa可以向sss发起一个PR,就是pull request,那么这个pr如果被合并到sss上之后,你就可以在本地添加sss's remote repository, and then pull down other people's modifications.

    The corresponding git command is as follows:
    Suppose your remote warehouse dddfork来自sss,那么你可以clone下来ddd之后,添加远程sss is the warehouse

    git remote add sss <sss的git地址>

    If aaa修改了自己的仓库代码之后,向sss发起一个pull requestsss又合并了这个PR,那么你在本地可以pull下来sss changes

    git pull --rebase sss

    reply
    0
  • Cancelreply