Cannot build embeddings for a local git repo

Dear developers,

I’m using the VS Code extension and I find that the “enhanced context” of really helpful. However, it seems that Cody requires a remote origin for building embeddings.

In my case, I have a local git repo on my working computer and is not allowed to put it on a remote host like GitHub. How do I deal with it?

image

Hello @turbotides

The only workaround I know of is to add a placeholder remote repo. You can register with whatever github.com URL under your GH username you like, for example https://github/turbotide/testrepo

But be aware not to push or pull from this non-existent repo.

1 Like

@PriNova Yes, that works!

Thanks a lot!

@PriNova do you know why Cody requires this ?

It checks every 24 hours for new commits pushed to your GitHub repository to determine if creating new embeddings is necessary. This is done by comparing the commit hashes that are stored with the embeddings. The mentioned workaround will not update after 24 hours, even if there are changes in the code.

1 Like

Thanks @PriNova , this explains it.

Sorry to be thick, but does this mean that embeddings for a local repo with a mock/fake remote will stay behind the local code? I.e. local code will keep growing but the embeddings will be based on whatever the code in local repo was when Cody ran the first time.

Should one regularly delete/re-create embeddings then?

Yes, exactly. Or you mark your repo on GitHub as private and have an update every 24 hours.

1 Like

Argh! You lost me again :laughing: Do you mean mark your repo as private: Cody cannot access it, manually update local embeddings ? Or something else.

Sorry to be not clear enough.

If you do not like to pull your code to GitHub and use a fake remote, then you need to delete and re-embed regularly.

But if it is not a problem to pull your code to a private GitHub repo, then the embeddings will be updated regularly.

Sorry for what, for helping me? :slight_smile: Many thanks for your patience.

How do I do that? I.e. deleting embeddings? Assuming that’s what you meant by delete

Hey I don’t understand the solution above, I have a repo in my local can any one please explain me clearly what I need to do exactly step by step I’m very new in dev world.

I answered your question here: Connect repository for embeddings

1 Like