Checkout bitbucket pull requests locally

后端 未结 9 514
再見小時候
再見小時候 2020-12-08 02:48

I found this gist, showing how to check out a pull request locally from GitHub.

I\'m using bitbucket and I\'m looking for a similar function.

Can you help m

9条回答
  •  清歌不尽
    2020-12-08 03:04

    I followed this article Pull request Fetching.

    It worked but I found out I just need add one line to the current repo, rather than create a folk repo and an upstream repo. Run this line

    git config --add remote.origin.fetch '+refs/pull-requests/*/from:refs/remotes/origin/pr/*'

    You can also add it manually to the file .git/config in your project.

    Next run git pull you should see a list:

    • [new ref] refs/pull-requests/488/from -> origin/pr/488
    • [new ref] refs/pull-requests/666/from -> origin/pr/666

    Then you can run git checkout origin/pr/666 to get the pull request changes.

提交回复
热议问题