# Go seems to have lost track of gitconfig

**URL:** <https://discourse.gohugo.io/t/go-seems-to-have-lost-track-of-gitconfig/42741>\
**Category:** support\
**Tags:** modules\
**Created:** [February 1, 2023, 1:15pm UTC](https://discourse.gohugo.io/t/go-seems-to-have-lost-track-of-gitconfig/42741 "2023-02-01T13:15:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJP](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ajp/32/9028_2.png) [@AJP](https://discourse.gohugo.io/u/AJP)\
**Post date:** [February 1, 2023, 1:15pm UTC](https://discourse.gohugo.io/t/go-seems-to-have-lost-track-of-gitconfig/42741/1 "2023-02-01T13:15:47Z")

</div>

Prior to some updates, Go modules were downloading perfectly fine via SSH when running `hugo serve`.

This was enabled by adding entries like the following to `~/.gitconfig`

```auto
[url "git@github.com:user-name"]
  insteadOf = https://github.com/user-name

```

I now get this error:

```auto
go mod download: ... exit status 128:
	fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.

```

I have confirmed that the SSH key is configured correctly, as I am able to clone the repos for the modules in question, via SSH.

My `.gitconfig` file has not changed.

Also, the same error occurs if I add tat config to `.git/config` within the repo.

`hugo v0.92.2+extended` and `go version go1.17.1` on Linux.

Is there a way to double-check if go is finding `.gitconfig`?

---

<div class="post-metadata">

**Author:** ![AJP](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ajp/32/9028_2.png) [@AJP](https://discourse.gohugo.io/u/AJP)\
**Post date:** [February 1, 2023, 2:06pm UTC](https://discourse.gohugo.io/t/go-seems-to-have-lost-track-of-gitconfig/42741/2 "2023-02-01T14:06:53Z")

</div>

Ok as per this post [Hugo mod failing in v0.91.1 but works in v0.91.0 - #4 by techmagus](https://discourse.gohugo.io/t/hugo-mod-failing-in-v0-91-1-but-works-in-v0-91-0/36180/4), if I run `export HUGO_SECURITY_EXEC_OSENV=".*"` and then `hugo serve` it works. From then on it works in any other terminals without `HUGO_SECURITY_EXEC_OSENV`.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [February 3, 2023, 2:07pm UTC](https://discourse.gohugo.io/t/go-seems-to-have-lost-track-of-gitconfig/42741/3 "2023-02-03T14:07:47Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
