# Manual Init with Netlify CLI pointing to wrong git URI

**URL:** <https://answers.netlify.com/t/manual-init-with-netlify-cli-pointing-to-wrong-git-uri/4851>\
**Category:** Support\
**Tags:** netlify-cli, git, gatsby, deployment\
**Created:** [November 7, 2019, 4:05pm UTC](https://answers.netlify.com/t/manual-init-with-netlify-cli-pointing-to-wrong-git-uri/4851 "2019-11-07T16:05:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![titanean](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/titanean/32/3962_2.png) [@titanean](https://answers.netlify.com/u/titanean)\
**Post date:** [November 7, 2019, 4:05pm UTC](https://answers.netlify.com/t/manual-init-with-netlify-cli-pointing-to-wrong-git-uri/4851/1 "2019-11-07T16:05:02Z")

</div>

I have followed the steps with the Netlify CLI to manually init a gatsby site to deploy from a self-hosted GitLab instance. While this process has worked for me on past repos, on this repo, the init process is pointing to a relative path for the repo (group/project.git) name instead of the absolute path (git:domain.io/group/project.git). This is resulting in the build failing to find the repo because its pointing to the [netlify.com](http://netlify.com) domain ([Netlify App](http://app.netlify.com/sites/site-name/group/project.git)) instead of the GitLab SSH or HTTPS URL (ex. git:domain.com/group/project.git). since its a manual self-hosted GitLab repo, I can’t edit the repository url. How can I fix this error?

Full Deploy Logs:  
12:27:40 PM: Build ready to start  
12:27:47 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63  
12:27:47 PM: build-image tag: v3.3.2  
12:27:47 PM: buildbot version: a2bab682ae0761baa4d123ebd00c57be933655dc  
12:27:47 PM: Fetching cached dependencies  
12:27:47 PM: Failed to fetch cache, continuing with build  
12:27:47 PM: Starting to prepare the repo for build  
12:27:47 PM: git ref refs/heads/master does not exist or you do not have permission  
12:27:47 PM: Failing build: Failed to prepare repo  
12:27:47 PM: failed during stage ‘preparing repo’: git ref refs/heads/master does not exist

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [November 7, 2019, 4:30pm UTC](https://answers.netlify.com/t/manual-init-with-netlify-cli-pointing-to-wrong-git-uri/4851/2 "2019-11-07T16:30:47Z")

</div>

Hi there,

did you give this a read through already?

> [@Self hosted gitlab support](https://answers.netlify.com/t/self-hosted-gitlab-support/1478):
>
> Hi, I am trying out deployment using netlify cli option from self hosted gitlab repository to build. However I can link the site from the repository but unable to build the site from the my private repository hosted under the my own gitlab service in my premise. I followed this link, [Auto Deploy to Netlify from Self-hosted GitLab](https://coffeencoding.com/auto-deploy-to-netlify-from-self-hosted-gitlab). I am getting the following error in deploy log, 1:10:47 PM: Build ready to start 1:10:49 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63 1:10:49…

---

<div class="post-metadata">

**Author:** ![titanean](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/titanean/32/3962_2.png) [@titanean](https://answers.netlify.com/u/titanean)\
**Post date:** [November 7, 2019, 4:41pm UTC](https://answers.netlify.com/t/manual-init-with-netlify-cli-pointing-to-wrong-git-uri/4851/3 "2019-11-07T16:41:08Z")

</div>

Thanks so much for pointing me to this! I searched all day yesterday through the community and the google for this solution but couldn’t find it. Looks like its connected now!

---

<div class="post-metadata">

**Author:** ![perry](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/perry/32/16_2.png) [@perry](https://answers.netlify.com/u/perry)\
**Post date:** [November 7, 2019, 4:42pm UTC](https://answers.netlify.com/t/manual-init-with-netlify-cli-pointing-to-wrong-git-uri/4851/4 "2019-11-07T16:42:07Z")

</div>

babaam! great news. 😃
