# FetchContent\_Declare ignores GIT\_TAG

**URL:** <https://discourse.cmake.org/t/fetchcontent-declare-ignores-git-tag/7502>\
**Category:** Code\
**Tags:** os:linux\
**Created:** [February 20, 2023, 4:08pm UTC](https://discourse.cmake.org/t/fetchcontent-declare-ignores-git-tag/7502 "2023-02-20T16:08:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bugblatterbeast](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@bugblatterbeast](https://discourse.cmake.org/u/bugblatterbeast)\
**Post date:** [February 20, 2023, 4:08pm UTC](https://discourse.cmake.org/t/fetchcontent-declare-ignores-git-tag/7502/1 "2023-02-20T16:08:25Z")

</div>

```auto
FetchContent_Declare(
    Project
    GIT_REPOSITORY git@SERVER_ADDRESS:group/project.git
    GIT_TAG f0f0cce200188f4bab4cc30cba18615bef2420c0
    GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(Project)

```

I’ve also tried “GIT\_TAG TAG\_LABEL” and “GIT\_TAG origin/TAG\_LABEL”. The result is always the same:

```auto
...BUILD_DIR/_deps/project-src$ git status
On branch master
Your branch is up to date with 'origin/master'.

```

EDIT:  
cmake version 3.22.1  
OS: ubuntu 22.04

---

<div class="post-metadata">

**Author:** ![bugblatterbeast](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@bugblatterbeast](https://discourse.cmake.org/u/bugblatterbeast)\
**Post date:** [February 20, 2023, 4:53pm UTC](https://discourse.cmake.org/t/fetchcontent-declare-ignores-git-tag/7502/2 "2023-02-20T16:53:51Z")

</div>

OK, I made a mistake. Sorry to bother you.

There is another FetchContent\_Declare before that one and I didn’t realise that it also depends on that repository (so HEAD is already checked out). I thought that I’ve cleaned up all my projects and removed those kind of double references. But this is an old project and I obviously missed it.
