# Checkout is wonky and is preventing a monorepo style repo here

**URL:** <https://discuss.circleci.com/t/checkout-is-wonky-and-is-preventing-a-monorepo-style-repo-here/35313>\
**Category:** Build Environment\
**Created:** [April 6, 2020, 10:34pm UTC](https://discuss.circleci.com/t/checkout-is-wonky-and-is-preventing-a-monorepo-style-repo-here/35313 "2020-04-06T22:34:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deanorderly](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/deanorderly/32/25132_2.png) [@deanorderly](https://discuss.circleci.com/u/deanorderly)\
**Post date:** [April 6, 2020, 10:34pm UTC](https://discuss.circleci.com/t/checkout-is-wonky-and-is-preventing-a-monorepo-style-repo-here/35313/1 "2020-04-06T22:34:39Z")

</div>

We have our CI setup so no one can check into master and only branches named submit\_xxxx/xxx are picked up by CI. Once we push a brach, we simply need git clone, and then git checkout remoteBranch BUT instead the state of the checked out work is that master is already corrupted and is 4 commits ahead of remote master. This is not good as we are trying to grab the hash using git commands.

In fact, right after the circleCI checks out master, we switch to master since we want to do a git merge --squash so we can squash ALL developer commits into one single commit. We do git checkout master to find out ALL the commits are there already???

#!/bin/bash -eo pipefail  
git checkout master  
Switched to branch ‘master’  
Your branch is ahead of ‘origin/master’ by 4 commits.  
(use “git push” to publish your local commits)  
CircleCI received exit code 0

This is frustrating. the state of the repo is odd. How to fix this?
