Skip to content

Instantly share code, notes, and snippets.

@zacscoding
Last active December 28, 2018 06:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save zacscoding/3751f2adec8f9aaf42a64d3a49b750c5 to your computer and use it in GitHub Desktop.
bitbucket : fetch pull requests to local repository

Bitbucket fetch pull requests to local repository

Suppose created pull request develop from forked > develop

And then we can find url such as https://bitbucket.org/zacscoding/pull-req-test/develop

if we hover develop branch on the top. And then

fetch pull request

$ git fetch https://bitbucket.org/zacscoding/pull-req-test develop  

From https://bitbucket.org/zacscoding/pull-req-test/branch/develop
 * branch            HEAD       -> FETCH_HEAD

compare

$ git diff develop FETCH_HEAD  

checkout

$ git checkout FETCH_HEAD
Note: checking out 'FETCH_HEAD'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at ca906ee README.md edited online with Bitbucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment