How to locally fetch and checkout a pull request

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Cloud のみ - この記事は、 クラウド プラットフォームのアトラシアン製品にのみ適用されます。

目的

A user may want to locally fetch a Pull Request from Bitbucket Cloud, and check it out to test it out first before deciding to merge it. But what is the URL of the Pull Request? Here's a way to do it.

My original repository: sorcerial

My forked repository: sorcerial-fork

ソリューション

Step 1: Get the URL of the Merge request. For my case, it's https://bitbucket.org/gideon_koh/sorcerial-fork/branch/master :

Step 2: Enter into your local repository (mine is "sorcerial") via command line. Modify the URL a little into the format of git fetch <forked_repo_url> <branch> :


In fact, you can even check the diff between sorcerial/master and sorcerial-fork/master (which is now the FETCH_HEAD) by running the command - git diff master FETCH_HEAD:

(Please do take note that FETCH_HEAD is temporary and will most likely change when another git fetch/pull or some other operations is done.)

Step 3: If you want to check the Pull Request out, to experiment on it and to test it out first, simply run the command - git checkout FETCH_HEAD:


Step 4: And when you finally decided to merge the Pull Request, click the Merge button on Bitbucket Cloud

説明A user may want to locally fetch a Pull Request from Bitbucket Cloud, and check it out to test it out first before deciding to merge it. But what is the URL of the Pull Request? Here's a way to do it.
製品Bitbucket
プラットフォームクラウド
最終更新日: 2018 年 9 月 16 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.