Unable to clone the swift repository from GitHub

I am following the guide here, and am running into an issue when cloning the swift repository for the first time:

/Users/username/Downloads/swift-project/ninja failed (ret=128): ['git', 'fetch', '--recurse-submodules=yes', '--tags']
kex_exchange_identification: read: Operation timed out
banner exchange: Connection to port 22: Operation timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

update-checkout failed, fix errors and try again

I have taken the following steps:

$ ninja --version
$ cmake --version
cmake version 3.22.2
// I have not installed sccache because of issues > 0.2.14 and I am cloning the repo as a one-off.
mkdir swift-project
cd swift-project
git clone git@github.com:apple/swift.git swift
cd swift
utils/update-checkout --clone-with-ssh

I don't understand what I am doing wrong, this seems like a foundational step. I meet the macOS requirements, use Xcode 13.2, meet the disk space requirements, and python installation requirements.

I have uploaded my SSH keys to my GitHub account and other ssh commands worked. I have also tried deleting some folders and re-cloning those repositories. Note that iCloud Drive is not an issue here since I have cloned the swift-project into my Downloads folder.

I hope you can help! I would be interested to understand how swift works.

Does utils/update-checkout work for you without the --clone-with-ssh flag?

Thanks for the reply! I just tried to run utils/update-checkout without the --clone-with-ssh flag, however I get the same error.

This looks like some local configuration issue to me. I'd recommend you try cloning on a different machine, maybe on a different network? Also, check out answers to a similar StackOverflow question. I'm not sure where exactly comes into play, you may need to run some network diagnostics to fix this. Maybe you have some firewall enabled that blocks you from reaching port 22?

1 Like

Thanks for the help! I managed to solve the issue by changing my network config.

1 Like