Getting an Git related Error when trying to build or serve with new theme

jekyll -v: jekyll 3.7.2

Expected behaviour:

Tobiass-MBP:tobi.codes Tobias$ bundle exec jekyll serve
Configuration file: /Users/Tobias/Jekyll Blog/tobi.codes/_config.yml
            Source:  /Users/Tobias/Jekyll Blog/tobi.codes/
       Destination:  /Users/Tobias/Jekyll Blog/tobi.codes/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 0.62 seconds.
 Auto-regeneration: enabled for ' /Users/Tobias/Jekyll Blog/tobi.codes/'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

Actual behaviour:

Tobiass-MBP:tobi.codes Tobias$ bundle exec jekyll serve
Configuration file: /Users/Tobias/Jekyll Blog/tobi.codes/_config.yml
            Source: /Users/Tobias/Jekyll Blog/tobi.codes
       Destination: /Users/Tobias/Jekyll Blog/tobi.codes/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
  Liquid Exception: No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository. in /_layouts/default.html
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository.

Description:
For some reason, I can’t build or serve my jekyll site without “configuring a repo name”. I have no clue why there would be a repo name needed for a local build or how to add the repo name.

This is the first time this happened. I tried to migrate the default site from “minima” to “jekyll-theme-primer”. When I fired it up in minima it outputted me the default side. I migrated the default post, index.md and about to layout default. It does not fire up and throws me this error. Can somebody specify how to move on from here?

I believe it has to do with the github-metadata plugin that is loaded by the GitHub Pages gem.

The instructions for adding the repository name can be found here:

https://help.github.com/articles/repository-metadata-on-github-pages/

You add the following to your _config.yml file:

repository: <USERNAME>/<PROJECT>