# Checkout script adds commits to master from $CIRCLE\_BRANCH

**URL:** <https://discuss.circleci.com/t/checkout-script-adds-commits-to-master-from-circle-branch/14194>\
**Category:** Bug Reports\
**Created:** [July 12, 2017, 4:14pm UTC](https://discuss.circleci.com/t/checkout-script-adds-commits-to-master-from-circle-branch/14194 "2017-07-12T16:14:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![rishimkumar](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rishimkumar/32/4798_2.png) [@rishimkumar](https://discuss.circleci.com/u/rishimkumar)\
**Post date:** [July 12, 2017, 4:39pm UTC](https://discuss.circleci.com/t/checkout-script-adds-commits-to-master-from-circle-branch/14194/2 "2017-07-12T16:39:12Z")

</div>

If I understand correctly,

We optimize checkout significantly and only guarantee that the current branch checkout matches the branch that should be built.

you could run `git fetch && git merge-base origin/master HEAD` to get your desired behavior

thanks!  
RK

---

_[View the full topic](https://discuss.circleci.com/t/checkout-script-adds-commits-to-master-from-circle-branch/14194)._
