# Running git commands in private repo inside docker not working correctly

**URL:** <https://meta.discourse.org/t/running-git-commands-in-private-repo-inside-docker-not-working-correctly/67321>\
**Category:** Development\
**Created:** [August 2, 2017, 1:33pm UTC](https://meta.discourse.org/t/running-git-commands-in-private-repo-inside-docker-not-working-correctly/67321 "2017-08-02T13:33:01Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![net\_deamon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/net_deamon/32/70126_2.png) [@net\_deamon](https://meta.discourse.org/u/net_deamon)\
**Post date:** [August 2, 2017, 1:33pm UTC](https://meta.discourse.org/t/running-git-commands-in-private-repo-inside-docker-not-working-correctly/67321/1 "2017-08-02T13:33:01Z")

</div>

I am working on bitbucket support for the docker\_manager plugin. It does not work well with [private repositories](https://meta.discourse.org/t/update-private-plugin-without-rebuilding-the-application/63286/).

The plugin works by running the following commands to check the `commits behind`

**latest\_local\_commit** `git rev-parse --short HEAD` (local repo latest commit)

**latest\_origin\_commit** `git rev-parse --short origin/master` (server repo latest commit)

**commits\_behind** `git rev-list --count HEAD..origin/master` to fetch the difference in number

The problem is that when I run the command of commit\_behind in command line inside docker container plugin repository, I get 0.  
But there are actually some commits made in the bitbucket private repository.  
When I check locally in my machine, I rightly get the commits\_behind number as 2.

I have added the ssh keys in /root/.ssh folder for the bitbucket repo. I am not able to understand why would the git command show 0 inside docker container (incorrect) but 2 in local machine(correct)

---

_[View the full topic](https://meta.discourse.org/t/running-git-commands-in-private-repo-inside-docker-not-working-correctly/67321)._
