Home
Support Forums

Anyway around git clone, i cant deploy my site

I read that i couldnt use the git clone feature for a hugo template… ):

If this is my problem with not getting it live, is there an easy way of fixing this for the devcows/universal-template. Universal | Hugo Themes

Its my first time using Netlify, and building a static site like this. Here is the deploy log.

10:04:34 PM: Build ready to start
10:04:35 PM: build-image version: 653805ca4a64301556e56dc4b321ef8fc20cbb7c
10:04:35 PM: build-image tag: v3.8.2
10:04:35 PM: buildbot version: 27121fae4d1b3a5c621e9bbd5ca8c7f99e19f330
10:04:36 PM: Fetching cached dependencies
10:04:36 PM: Failed to fetch cache, continuing with build
10:04:36 PM: Starting to prepare the repo for build
10:04:36 PM: No cached dependencies found. Cloning fresh repo
10:04:36 PM: git clone GitHub - GittyHubDella/happyhouses
10:04:38 PM: Preparing Git Reference refs/heads/master
10:04:38 PM: Parsing package.json dependencies
10:04:38 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: β€˜β€™ versus β€˜/’ in the Netlify UI
10:04:39 PM: Starting build script
10:04:39 PM: Installing dependencies
10:04:39 PM: Python version set to 2.7
10:04:40 PM: v12.18.0 is already installed.
10:04:40 PM: Now using node v12.18.0 (npm v6.14.4)
10:04:41 PM: Started restoring cached build plugins
10:04:41 PM: Finished restoring cached build plugins
10:04:41 PM: Attempting ruby version 2.7.2, read from environment
10:04:42 PM: Using ruby version 2.7.2
10:04:42 PM: Using PHP version 5.6
10:04:42 PM: Started restoring cached go cache
10:04:42 PM: Finished restoring cached go cache
10:04:43 PM: go version go1.14.4 linux/amd64
10:04:43 PM: go version go1.14.4 linux/amd64
10:04:43 PM: Installing missing commands
10:04:43 PM: Verify run directory
10:04:43 PM: ​
10:04:43 PM: ────────────────────────────────────────────────────────────────
10:04:43 PM: Netlify Build
10:04:43 PM: ────────────────────────────────────────────────────────────────
10:04:43 PM: ​
10:04:43 PM: ❯ Version
10:04:43 PM: @netlify/build 17.9.2
10:04:43 PM: ​
10:04:43 PM: ❯ Flags
10:04:43 PM: baseRelDir: true
10:04:43 PM: deployId: 610cc2e2fd210e47dc64df7f
10:04:43 PM: ​
10:04:43 PM: ❯ Current directory
10:04:43 PM: /opt/build/repo
10:04:43 PM: ​
10:04:43 PM: ❯ Config file
10:04:43 PM: No config file was defined: using default values.
10:04:43 PM: ​
10:04:43 PM: ❯ Context
10:04:43 PM: production
10:04:43 PM: ​
10:04:43 PM: ────────────────────────────────────────────────────────────────
10:04:43 PM: 1. Build command from Netlify app
10:04:43 PM: ────────────────────────────────────────────────────────────────
10:04:43 PM: ​
10:04:43 PM: $ hugo serve
10:04:43 PM: Error: Unable to find theme Directory: /opt/build/repo/themes/hugo-universal-theme
10:04:43 PM: ​
10:04:43 PM: ────────────────────────────────────────────────────────────────
10:04:43 PM: β€œbuild.command” failed
10:04:43 PM: ────────────────────────────────────────────────────────────────
10:04:43 PM: ​
10:04:43 PM: Error message
10:04:43 PM: Command failed with exit code 255: hugo serve
10:04:43 PM: ​
10:04:43 PM: Error location
10:04:43 PM: In Build command from Netlify app:
10:04:43 PM: hugo serve
10:04:43 PM: ​
10:04:43 PM: Resolved config
10:04:43 PM: build:
10:04:43 PM: base: /opt/build/repo
10:04:43 PM: command: hugo serve
10:04:43 PM: commandOrigin: ui
10:04:43 PM: publish: /opt/build/repo/public
10:04:43 PM: publishOrigin: ui
10:04:44 PM: Caching artifacts
10:04:44 PM: Started saving build plugins
10:04:44 PM: Finished saving build plugins
10:04:44 PM: Started saving pip cache
10:04:44 PM: Finished saving pip cache
10:04:44 PM: Started saving emacs cask dependencies
10:04:44 PM: Finished saving emacs cask dependencies
10:04:44 PM: Started saving maven dependencies
10:04:44 PM: Finished saving maven dependencies
10:04:44 PM: Started saving boot dependencies
10:04:44 PM: Finished saving boot dependencies
10:04:44 PM: Started saving rust rustup cache
10:04:44 PM: Finished saving rust rustup cache
10:04:44 PM: Started saving go dependencies
10:04:44 PM: Finished saving go dependencies
10:04:47 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:04:47 PM: Creating deploy upload records
10:04:47 PM: Failing build: Failed to build site
10:04:47 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
10:04:47 PM: Finished processing build request in 11.471282436s

In your config.toml you have

theme = "hugo-universal-theme"
themesDir = "themes"

but in your repo you have no themes directory.

Here are Netlify’s Hugo docs for reference.

Alternatively, you could build locally and deploy via Netlify CLI.

1 Like

Thank you so much for responding,

I removed the .gitingore file from my project locally.

I’m not quite sure how the git pull request works. I’m new to all of this.

root@Joseph:/mnt/d/coachella_locations_site/newSite/website# git push origin master
Username for β€˜https://github.com’: gittyhubdella
Password for β€˜https://gittyhubdella@github.com’:
To GitHub - GittyHubDella/happyhouses
! [rejected] master β†’ master (fetch first)
error: failed to push some refs to β€˜GitHub - GittyHubDella/happyhouses’
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., β€˜git pull …’) before pushing again.
hint: See the β€˜Note about fast-forwards’ in β€˜git push --help’ for details.

So this means there is something in the github repository that you don’t have locally (as I’m not in front of your computer, I cannot say what that is) so you need to fetch from remote first. I can see that themes/ is in the .gitignore in the remote repository which is the cause of your original issue.

GitHub pull request documentation might help.

1 Like