简体   繁体   中英

move git pull requests from bitbucket to github?

My client was using Bitbucket for his git repo, I made a lot of work, created many pull requests in it, but recently he moved his repo to Github without my pull requests.

How I can move pull requests to copied Github repo?

I saw that post: How to move git repository with all branches from bitbucket to github? , but over there they discuss moving the repo itself with everything else, but in my case I just need to move pull requests only.

One simple option is to:

  • fork that new GitHub repo into your own account
  • clone that fork (that you own)
  • add as a git remote a reference to the BitBucket repo (which might have a different history, different sha1)

     git remote add bitbucket https://bitbucket.org/account/repo git fetch bitbucket 
  • create a local branch (git checkout -b mypatch)

  • cherry-pick the commits of the bitbucket/yourBranch (with yourBranch being the branch where you were doing patches for your BitBucket pull request).
    That will replay the commits of your BitBucket patch branch onto your new local branch.

  • push that new local branch to your GitHub fork

  • trigger a new pull request from that newly pushed branch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM