How to source a theme from a private git repository

(Sam Saffron) #1

In some setups you may prefer that your site’s themes are in a private git repository.

To do so:

Use the clone with SSH link, not the one that starts with https


Select theme is in a private git repository:

Paste in the public key into your git repo so it is the used as a “deploy key”

Click “Import” and you are done :confetti_ball:

Discourse will remember the private key it generated and use it to access the git repo.

(Jean Christophe “Jice” Lavocat) #7

Hi @sam,
This is an awesome feature.
Can it work with any repository on Git?

I tried with, but Discourse returns a

Error cloning git repository, access is denied or repository is not found

I guess it comes from somewhere in my setup, but I just wanted to be sure that gitlab was ok.

(Vinoth Kannan) #8

Yes, it should work with any Git repo. But you must use the SSH clone URL like Also try by pulling the latest version of Discourse.

(Jean Christophe “Jice” Lavocat) #9

I just updated my Discourse (yet was just one commit behind).
I still get the error message.

Vinoth, let me know if I should open a new discussion, I’m probably polluting here… not sure. Tell me and I’ll delete my messages from here to repost them in a correct section.

(Vinoth Kannan) #10

Can you try it GitHub. If it worked then it must be GitLab specific issue.

(Jean Christophe “Jice” Lavocat) #11

I have no private Github repo.
However, I face the same issue with Bitbucket private repo.