解決建立 GIT 檔案庫遇到 fatal: protocol 'https' is not supported 錯誤

使用 SourceTree 建立 GIT 檔案庫 (repository) 遇到 fatal: protocol 'https' is not supported 錯誤訊息。解決方式將 GIT 檔案庫 https 的連結改成 http

Photo by Christina Morillo on StockSnap


錯誤狀況

使用 SourceTree 建立 GIT 檔案庫 (Clone from URL) 遇到 fatal: protocol 'https' is not supported。

git -c filter.lfs.smudge= -c filter.lfs.required=false -c color.branch=false -c color.diff=false -c color.status=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree clone https://gitlab.com/USER/project_name.git /Users/USER/GitRepo/project_name 

Cloning into '/Users/USER/GitRepo/project_name'...

warning: templates not found in /usr/local/git/share/git-core/templates

fatal: protocol '/private/var/folders/wf/nb3xxx/T/https' is not supported

Completed with errors, see above

解決方式

原本 GIT 檔案庫連結是 

https://gitlab.com/USER/project_name.git

將 https 的連結改成 http

http://gitlab.com/USER/project_name.git

就可以順利 git clone。之後,如果偏好使用 https 可以自行到選單 Repository Settings 修改 Remotes 中 name 為 origin 的檔案庫連結。

參考資料


留言