Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to locally fetch a merged pull request

I found this post and followed the steps but am getting inconsistent results. Usually the head of my qa branch. Is this because the PR is already merged? 

 

https://confluence.atlassian.com/bbkb/how-to-locally-fetch-and-checkout-a-pull-request-724402529.html

 

 

1 answer

1 accepted

1 vote
Answer accepted

Hello @Bryan_Forst ,

The source branch of a pull request might not exist anymore, so referencing it by name may not work. I'd suggest to use commit hashes instead.

For a merged pull request you should be able to see the merge commit hash in the UI: Pull Request #9: Migrate to Kotlin, rewrite discovery and storage, add c… 2020-04-03 11-17-51.png

Or, in the old PR experience:

 Pull request #9: Migrate to Kotlin, rewrite discovery and storage, add c… 2020-04-03 11-18-33.png

Now, that merge commit has two parents: first one is the tip of the PR target branch just before merging, and the second one is the tip of the PR source branch at the same time.

bitbucket-linky 2020-04-03 11-26-29.png

What you can do is first checkout the merge commit and then reset to the second parent – this way you'll end up on the tip of the source branch of the PR. In my case it would be this:

git checkout 4833f0c
git reset HEAD^2

In my example this will bring me to c144df0. If I understand correctly, this is what you're trying to achieve.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Hi Daniil, 

So far that seems to be working perfectly, thanks!

 

Bryan

Like Daniil Penkin likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

464 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you