cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.02k stars 7.05k forks source link

Update protocol to submodules #20726

Open QuellaZhang opened 2 years ago

QuellaZhang commented 2 years ago

Submodules will no longer download as the git: protocol, reference https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git, update the protocol to https://. Fixed https://github.com/cocos2d/cocos2d-x/issues/20714.

QuellaZhang commented 2 years ago

Can someone help approve the PR? Thanks!

stevetranby commented 2 years ago

I just pulled down fresh git clone to test out v4 again and ran into this issue. Ideally someone who can merge this will also update the v3 branch with the same replace git:// with https://.

slackmoehrle commented 2 years ago

@stevetranby I just tried v4 on an M1 machine (I finally own one) and I ran into this issue. Let's get it in front of engineering to have the fix merged for v4 and v3 branches.

I have this in .gitmodules

[submodule "tools/cocos2d-console"]
        path = tools/cocos2d-console
        url = https://github.com/cocos2d/cocos2d-console.git
[submodule "tools/bindings-generator"]
        path = tools/bindings-generator
        url = https://github.com/cocos2d/bindings-generator.git
[submodule "tests/cpp-tests/Resources/ccs-res"]
        path = tests/cpp-tests/Resources/ccs-res
        url = https://github.com/dumganhar/ccs-res.git

but I still seem to be doing the same error:

% git submodule update --init
Cloning into '/Users/jasmine/sandbox/cocos2d-x/tests/cpp-tests/Resources/ccs-res'...
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/dumganhar/ccs-res.git' into submodule path '/Users/jasmine/sandbox/cocos2d-x/tests/cpp-tests/Resources/ccs-res' failed
Failed to clone 'tests/cpp-tests/Resources/ccs-res'. Retry scheduled
Cloning into '/Users/jasmine/sandbox/cocos2d-x/tools/bindings-generator'...
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/cocos2d/bindings-generator.git' into submodule path '/Users/jasmine/sandbox/cocos2d-x/tools/bindings-generator' failed
Failed to clone 'tools/bindings-generator'. Retry scheduled
Cloning into '/Users/jasmine/sandbox/cocos2d-x/tools/cocos2d-console'...
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/cocos2d/cocos2d-console.git' into submodule path '/Users/jasmine/sandbox/cocos2d-x/tools/cocos2d-console' failed
Failed to clone 'tools/cocos2d-console'. Retry scheduled
Cloning into '/Users/jasmine/sandbox/cocos2d-x/tests/cpp-tests/Resources/ccs-res'...
fatal: remote error:
  The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/dumganhar/ccs-res.git' into submodule path '/Users/jasmine/sandbox/cocos2d-x/tests/cpp-tests/Resources/ccs-res' failed
Failed to clone 'tests/cpp-tests/Resources/ccs-res' a second time, aborting

did I make a mistake? I also read the blog post.

stevetranby commented 2 years ago

Not sure why it's not using the https version, but your git submodule command looks like it tried to clone from the git:// protocol version:

fatal: clone of 'git://github.com/dumganhar/ccs-res.git'

You need to figure out how to get the git submodule command to use the updated .gitmodules? Not sure how? Maybe you have something cached? Maybe you updated the wrong .gitmodules? Maybe you need to restart (for the proverbial fixes everything potential?)

pvgmenegasso commented 2 years ago

I also ran into the same issue and fixing the .gitmodules file was not sufficient. I also had to edit .git/config file and replace git refferences with https url. I recommend adding a note on the README or approving the PR asap to avoid recurring errrors

pvgmenegasso commented 2 years ago

Link to pull request

raulcesar commented 2 years ago

Until the fix is merged, I resolved problem by running the following command (which makes git run https protocol instead of git for github.com:

git config --global url.https://github.com/.insteadOf git://github.com/
huhuang03 commented 1 year ago

Please check this. Yes, the git protocol can't work now. The error log is:

Cloning into 'F:/cocos2d-x/tests/cpp-tests/Resources/ccs-res'...
fatal: unable to connect to github.com:
github.com[0: 20.205.243.166]: errno=Unknown error

fatal: clone of 'git://github.com/dumganhar/ccs-res.git' into submodule path 'F:/cocos2d-x/tests/cpp-tests/Resources/ccs-res' failed
Failed to clone 'tests/cpp-tests/Resources/ccs-res' a second time, aborting