Back

[SOLVED] Git error on CLI function creation

  • 0
  • Functions
Osman
11 Sep, 2023, 13:49

I get the following error when trying to create a function using the appwrite CLI(4.0.0)

TypeScript
$ appwrite init function
? What would you like to name your function? test
? What ID would you like to have for your function? unique()
? What runtime would you like to use? Node.js (node-18.0)
βœ— Error Command failed: cmd /c "git clone -b v3 --single-branch --depth 1 --sparse https://github.com/appwrite/functions-starter ."
error: unknown option `sparse'
usage: git clone [<options>] [--] <repo> [<dir>]
    ...
Suggestion: Try updating your git to the latest version, then trying to run this command again.

The function is still created in the appwrite console, but nothing is added to the appwrite.json and no files are added to functions/test.

Now, im not actually interested in automatic deployment with git, since i already have a deployment pipeline setup. However, it seems that git deployment is being forced since the new update? When i create functions through the appwrite console, i'm forced to connect to git. So is that just how it is now? Or can i avoid this whole git deployment procedure, either in the console or using the CLI.

TL;DR
The user encountered a git error while trying to create a function using the Appwrite CLI. They received an error message that suggested updating their git version. The user realized that they misunderstood the error and that it was not related to automatic git deployment. They resolved the issue by updating their git version. The user also mentioned that they are not interested in automatic deployment with git and wondered if they can avoid it. There is no solution provided for this particular issue in the support thread.
Binyamin
11 Sep, 2023, 13:52

The function you've created it is indeed local one and connected to git, Appwrite uses git to get the starter code for your function

Binyamin
11 Sep, 2023, 13:53

What version of git you have?

Binyamin
11 Sep, 2023, 13:53
TypeScript
git --version
Osman
11 Sep, 2023, 13:55

git version 2.24.0.windows.2

Osman
11 Sep, 2023, 13:56

Ah i see, its trying to fetch the starter-function code from github appwrite.

Binyamin
11 Sep, 2023, 13:57

Can you upgrade to latest one (42) and try again

Osman
11 Sep, 2023, 14:02

That worked πŸ™‚ Thats my bad, i thought the git error was because the function was trying to force the function into appwrite's automatic git deployment, like the console does. Thanks for your help

Binyamin
11 Sep, 2023, 14:02

<:appwritefire:823999000330895380>

Osman
11 Sep, 2023, 14:03

[SOLVED] Git error on CLI function creation

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more