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

Detect Revert Commit in pipeline

Is There a way to detect Revert action in commit history when running pipeline steps
the worst behave maybe by detecting commit message

I want to clear cache if there's revert action, there's a rare case when revert happen after success packages from composer install being cached but reverted then it use successful cached

1 answer

1 accepted

0 votes
Answer accepted

Hi @xicond,

By 'revert action', are you referring to a git revert?

If so, I don't believe there is an automated way to detect this. A revert commit is just a normal commit for Git.

If you standardize your revert commit messages, you could write a script that gets the commit message of the commit that triggered the pipeline and looks for specific words or phrases in order to figure out if it is a revert commit; then use this script in your pipelines build.

You can use any of the following two commands in your Pipelines build to get the message of the commit that triggered the pipeline:

git log -n 1 --pretty=format:%s $BITBUCKET_COMMIT

git show -s --format=%B $BITBUCKET_COMMIT

You would need to make sure in this case that all users who work on this repo use the standard message for revert commits only and not for any other type of commits.

Kind regards,

Suggest an answer

Log in or Sign up to answer
Site Admin

Atlassian Community Events