Checkout bitbucket pull requests locally

后端 未结 9 464
再見小時候
再見小時候 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:09

    In bitbucket what you can do is

    git config remote.origin.fetch "+refs/heads/:refs/remotes/origin/"
    

    and then

    git fetch
    

    after that you can checkout to the branch you want to

    git checkout BRANCH_NAME
    

    P.S: Hopefully bitbucket will sort this out https://jira.atlassian.com/browse/BCLOUD-5814

    0 讨论(0)
  • 2020-12-08 03:11

    One may fetch the code from Bitbucket Server's pull requests using:

    git fetch origin refs/pull-requests/$PR_NO/from:$LOCAL_BRANCH
    
    0 讨论(0)
  • 2020-12-08 03:18

    When is not possible to checkout the pull request, a trick is that you can checkout the last commit of that pull request

    git checkout <hash code of last commit>
    
    0 讨论(0)
提交回复
热议问题