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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

getting last commit before push of a specific build



sometimes when working a user accumulates multiple local commits before pushing to the origin.

in that case, BITBUCKET_COMMIT will only point to the last one.

is it possible to somehow get the range of commits that triggered the build?

it is necessary for my team in order to determine which services changed during the last update and only build them.


in addition to that, better support for mono-repos could be really great.


2 answers

1 vote

Ough, sorry, I thought this is discussion, not answer, so don't treat my post as answer please.


It's not totally correct heading of question. It's not commit range is required but the last commit hash BEFORE push happen.

So, idea is to check, manipulate only with files newely delivered by push triggered build. To be able to use something like `git diff --names-only ${BITBUCKET_PREVIOUS_COMMIT} HEAD`. Such functionality is highly demanded for CI server. Thanks.

I am looking for exact the same functionality!

Not only are you guys looking for this, it's also here


I find it kind of strange that Bitbucket Pipelines doesn't already have this functionality. I mean Travis CI has it (`TRAVIS_COMMIT_RANGE`), CircleCI somehow has it too and even Jenkins has something for this... I really prefer to stick with Pipelines to have an all-in-one power repo, but this kind of things really makes you think about using others...

Like Aaron Hong likes this

Still no solution for this?

Just in case someone needs this, I was looking for the way to get list of changed files on a pull-request trigger:

 git diff --name-only origin/${BITBUCKET_PR_DESTINATION_BRANCH}..origin/${BITBUCKET_BRANCH}

Please note that this will not work for "tag" trigger or custom pipelines because BITBUCKET_BRANCH is not set

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events