# Keep .git folder in when fetching a git repo

**URL:** https://discourse.nixos.org/t/keep-git-folder-in-when-fetching-a-git-repo/8590
**Category:** Help
**Created:** [August 15, 2020, 8:13pm UTC](https://discourse.nixos.org/t/keep-git-folder-in-when-fetching-a-git-repo/8590 "2020-08-15T20:13:51Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Thra11](https://discourse.nixos.org/user_avatar/discourse.nixos.org/thra11/32/2384_2.png) [@Thra11](https://discourse.nixos.org/u/Thra11)
#### Post date: [August 15, 2020, 10:44pm UTC](https://discourse.nixos.org/t/keep-git-folder-in-when-fetching-a-git-repo/8590/2 "2020-08-15T22:44:41Z")

</div>

> [@tobiasBora](#):
>
> However, `fetchFromGitHub` does not keep the .git repository,

Strictly speaking, `fetchFromGitHub` doesn’t fetch the .git directory in the first place, it just downloads tarballs. You can probably use `fetchgit` instead of `fetchFromGitHub`, and set `leaveDotGit = true`.

---

_[View the full topic](https://discourse.nixos.org/t/keep-git-folder-in-when-fetching-a-git-repo/8590)._
