Is there any way to add to existing repo?

I had to shuffle some stuff around after a failure on my Next project, and I can't re-install the theme to get everything back working again without deleting the entire repo and installing fresh. PLEASE - tell me there's a way for me to install the theme and then connect it to my existing repo after the fact? Is there something I'm missing?

Hi Mark,

Welcome to the community!

You can connect an exist repo to a theme easily. Instead of using the theme command on the Github URL, just use git clone github-url then edit the api endpoint in the prismic-configuration.js file or the sm.json file by adding you existing repo URL.

Let me know if you need any more assistance with this.

Thanks.

1 Like

When you say git clone github-url are you referring to my codebase, or the prismic github? I have my project synced locally right now, and prismic is installed and set up (technically), but I can't seem to get slicemachine to work, so I had to basically destroy it to re-add it. Essentially - What would one do after the prismic login step?

I keep getting an error that says [slice API] Unauthorized.

OK, I was referring to the github like:

git clone https://github.com/prismicio-community/nextjs-sm-tutorial-series

From what you saying it sounds like your repository doesn't have Slice Machine activated, if you give me you repo URL I can activate it for you.

It was active, but my sm.json file had a bad apiEndpoint in it. Once I fixed that, it seemed to fix everything. I really there was a command to bring an existing repo in through the cli. This install path is very convoluted, I'm afraid.

Yeah, I think you're right, I need to update this.

For Next.js we currently have:

  • Start from a sample project
  • Start from a Boilerplate
  • Configure a project automatically

Whereas for Nuxt.js we have:

  • Start from a sample project
  • Start from a Boilerplate
  • Configure a project automatically
  • Configure a Project Manually

It's this last one 'Configure a Project Manually' that would have helped you in this situation so I'll add this to the backlog to create this document for Next.js.

Thanks for the feedback.

1 Like

I appreciate it. Thanks!

This is being tracked in our documentation backlog, we'll update you here once this is published.