WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.46k stars 4.18k forks source link

wp-env start command fails with GitError #65657

Open saint-hilaire opened 3 weeks ago

saint-hilaire commented 3 weeks ago

Description

Hi all, thanks for this awesome package. I've used WordPress for a few years, but am quite new to developing it, gutenberg, and node.js. I thought I'd share some problems I had while trying to get wp-env to start.

When I try to start a local WordPress environment with wp-env start , the command fails with a GitError, thrown by the simple-git library, while trying to clone WordPress (see screenshot below). Because that repository is quite large, I prefer avoiding that action, by keeping a local copy of the code base, and pointing a .wp-env.json at my local copy, with the configuration "core": "/path/to/local/WordPress", which seems to work well.

However, wp-env start still fails with a GitError - this time, while trying to clone PHPUnit (see screenshot). Unfortunately, glancing over the code of wp-env, I see no workaround to this problem.

Expected behavior: wp-env sucessfully starts a local environment, with and without the configuration "core": "/path/to/local/WordPress"

Actual behavior: The command wp-env start fails with the simple-git library's GitError

Step-by-step reproduction instructions

  1. cd /path/to/some/local/wordpress-theme
  2. wp-env start
  3. wp-env throws GitError
  4. In the current directory, add the file .wp-env.json, containing the configuration "core": "/path/to/some/local/WordPress"
  5. wp-env start
  6. Still throws GitError

Screenshots, screen recording, code snippet

image GitError while trying to clone WordPress core

image GitError while trying to clone PHPUnit

Environment info

Please confirm that you have searched existing issues in the repo.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

mahmoudsaeed commented 3 days ago

I encountered the same error, but I was able to resolve it by configuring Git to use HTTP/1.1 instead:

git config http.version HTTP/1.1