# Shallow git fetch regression in discourse\_docker

**URL:** <https://meta.discourse.org/t/shallow-git-fetch-regression-in-discourse-docker/172324>\
**Category:** Support\
**Created:** [December 5, 2020, 11:24am UTC](https://meta.discourse.org/t/shallow-git-fetch-regression-in-discourse-docker/172324 "2020-12-05T11:24:46Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![dachary](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dachary/32/119731_2.png) [@dachary](https://meta.discourse.org/u/dachary)\
**Post date:** [January 5, 2021, 11:57pm UTC](https://meta.discourse.org/t/shallow-git-fetch-regression-in-discourse-docker/172324/16 "2021-01-05T23:57:31Z")

</div>

> [@Falco](#):
>
> `git fetch --depth=1 origin tag v2.5.0 --no-tags`

This does not work because it happens **after** the [code that fails because it cannot retrieve the version](https://github.com/discourse/discourse_docker/blob/master/templates/web.template.yml#L94). What worked was to create a `version.template.yml` next to [web.template.yml](https://github.com/discourse/discourse_docker/blob/master/templates/web.template.yml) with the following content:

```plaintext
params:
  home: /var/www/discourse

run:
  - exec:
      cd: $home
      hook: code
      cmd:
        - git fetch --tags

```

And then include this file in `containers/app.yml`, before `web.template.yml` like so:

```plaintext
templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/version.template.yml"
  - "templates/web.template.yml"

```

---

_[View the full topic](https://meta.discourse.org/t/shallow-git-fetch-regression-in-discourse-docker/172324)._
