首页 > git > 如果我使用多个远程存储库(Github和BitBucket),其他合作者会知道吗?

如果我使用多个远程存储库(Github和BitBucket),其他合作者会知道吗? (If I use multiple remote repositories (Github and BitBucket), will other collaborators know?)

问题

我正在看这个响应来设置多个远程存储库。

如果我在BitBucket上与合作者一起工作,他们是否有办法知道我在Github上设置了它?或者只是我在当地知道的?

我不想让合作者有任何困惑。如果我重命名遥控器,它也会被重命名吗?

对于道德问题,这是一个类项目,我也希望在我的Github上跟踪它。

解决方法

如果我在BitBucket上与合作者一起工作,他们是否有办法知道我在Github上设置了它?

大多数情况下没有,尽管有可能泄露信息。如果从远程使用merge进行提取,则可以将远程的名称或URL添加到提交消息中。您应该始终验证合并的内容和推送的内容。

或者只是我在当地知道的?

大多数情况下是肯定的(上面的自动合并除外)。当pull和push git对来自其数据库(提交,树,文件和带注释的标签)的对象进行操作时,这些对象未分配给远程控制器,并且不存储有关远程控制器的信息。Git还提取/推送也不包含有关遥控器信息的引用(分支和轻量级标记)。

有关遥控器的信息存储在您的本地,.git/config但它从未拉动或推动。直到你将它的副本添加到repo并推送,所以你必须避免这种情况。

我不想让合作者有任何困惑。如果我重命名遥控器,它也会被重命名吗?

不,他们的遥控器是他们的。

问题

I'm looking at this response to set up multiple remote repositories.

If I work with collaborators on BitBucket, is there a way of them knowing I have it set up with Github as well? Or is that only known to me locally?

I don't want to cause collaborators any confusion. If I rename the remotes will it be renamed for them too?

For ethical concerns, this is for a class project that I also want to be tracked on my Github for later.

解决方法

If I work with collaborators on BitBucket, is there a way of them knowing I have it set up with Github as well?

Mostly no, though there is a chance of information leak. If you pull with merge from a remote the name or URL of the remote could be added to the commit message. You should always verify what you merge and what you push.

Or is that only known to me locally?

Mostly yes (except for automatic merge above). When pull and push git operates on objects from its database (commits, trees, files and annotated tags) that aren't assigned to remotes and don't store information about remotes. Git also fetches/pushes references (branches and lightweight tags) that also don't contain information about remotes.

Information about remotes is stored in your local .git/config but it's never pulled or pushed. Until you add a copy of it to the repo and push so you have to avoid that.

I don't want to cause collaborators any confusion. If I rename the remotes will it be renamed for them too?

No, their remotes are theirs.

相似信息