# Jenkins pipeline-as-code: not a git repository

**URL:** <https://community.jenkins.io/t/jenkins-pipeline-as-code-not-a-git-repository/6275>\
**Category:** Using Jenkins\
**Tags:** question\
**Created:** [March 15, 2023, 9:20am UTC](https://community.jenkins.io/t/jenkins-pipeline-as-code-not-a-git-repository/6275 "2023-03-15T09:20:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [March 15, 2023, 12:57pm UTC](https://community.jenkins.io/t/jenkins-pipeline-as-code-not-a-git-repository/6275/2 "2023-03-15T12:57:22Z")

</div>

> [@jgeens](#):
>
> `not in a git directory`

Command line git resolved a security vulnerability by increasing the strictness they apply to the ownership of files and directories. If git files or directories are owned by a user other than the user running the command line git process, then recent releases of command line git fail with the `not in a git directory` message.

Check the file and directory ownerships on the controller and on the agents. They must be owned by the user that is running command line git.

The behavior is not something that Jenkins controls. Refer to [JENKINS-70540](https://issues.jenkins.io/browse/JENKINS-70540) for more details

---

_[View the full topic](https://community.jenkins.io/t/jenkins-pipeline-as-code-not-a-git-repository/6275)._
