【问题标题】:Commit on Bitbucket trigger synchronisation with Github repository?提交 Bitbucket 触发器与 Github 存储库同步?
【发布时间】:2021-12-05 07:54:41
【问题描述】:

我正在使用外部 Bitbucket 存储库,当我提交时,我希望所有更改与 Github 存储库同步。有可能吗?

我需要它,因为“azure web app”适用于 github 存储库,但不适用于外部 bitbucket 存储库。

【问题讨论】:

  • 是的,问题解决了,谢谢
  • 如果我的回答对您有帮助,您可以投票并接受它作为答案(点击答案旁边的复选标记,将其从灰色切换为填写)。这可能对其他社区成员有益。

标签: git azure github bitbucket


【解决方案1】:

谢谢Tyler T。发布您的建议作为帮助其他社区成员的答案。

您可以在本地计算机上拥有一个存储库,并将其设置为拥有多个远程。你可以这样试试:

# cd into the folder on your machine
# maybe the origin is set to Github, pull the latest changes

git pull origin master

# set Bitbucket as another remote named 'bitbucket'

git remote add bitbucket git@bitbucket.org:username/repo-name.git

# push the repo to the new remote 'bitbucket'

git push bitbucket master

# now the Bitbucket repo is up-to-date

现在,只要您进行更改并推送到 Github (origin),您就可以 push 到另一个 remote (bitbucket) 以保持同步。要使用高级解决方案,您可以尝试使用 Webhooks 自动同步它们。

您可以参考How to sync a Bitbucket repo to a Github repoA BitBucket CI/CD Pipeline to Sync Branches With GitHub

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多