如何在 github 上打开拉取请求以改进 bitbucket 分叉?

How to open a pull request on github for an improvement in a bitbucket fork?

我将 github 存储库克隆到我们的 Bitbucket 帐户中。类似于 https://gist.github.com/sangeeths/9467061.

我修复了位于 bitbucket 中的存储库中的错误。我想在修复错误的原始 github 存储库上打开拉取请求。

如果我的叉子位于 github,我会简单地跟随 these instructions,但由于我的叉子在 bitbucket 上,我不知道从哪里开始。

如何打开从我的 bitbucket 存储库到原始 github 存储库的拉取请求?

您可以:

  • 将原始 GitHub 存储库克隆到不同的文件夹
  • 将您的本地 BitBucket 存储库添加为远程存储库
  • 获取你的修复分支(确保你的修复是在它自己的分支中完成的,而不是 master
  • 使用 cli/cli GitHub 命令行界面 gh pr create 创建 PR

即:

git clone https://github.com/original/repo
cd repo
git remote add bb ../yourLocalBitbucket/repo
git fetch bb
git checkout bb/fix
gh pr create

gh pr create 命令将为您完成工作:

When the current branch isn’t fully pushed to a git remote, a prompt will ask where to push the branch and offer an option to fork the base repository.