[英]Pushing local git repository from Matlab fails: You can't push to git://github.com/user/repo.git use https://github.com/user/repo.git
I recently started using GitHub because I want to share some Matlab code with a coworker.我最近开始使用 GitHub,因为我想与同事分享一些 Matlab 代码。 However, I cannot seem to get the Git integration to push my changes to the online repository.
但是,我似乎无法通过 Git 集成将我的更改推送到在线存储库。 I have tried using the SVN integration with https://github.com/user/repo.git and the Git integration with git://github.com/user/repo.git with no success.
我曾尝试将 SVN 与https://github.com/user/repo.git集成,并将 Git 与 git://github.com/user/repo.git 集成,但没有成功。
Every time I select Push from the Source Control menu I get the following error message: git://github.com/user/repo.git: You can't push to git://github.com/user/repo.git Use https://github.com/user/repo.git每次我从 Source Control 菜单中选择 Push 时,我都会收到以下错误消息:git://github.com/user/repo.git: You can't push to git://github.com/user/repo.git使用https://github.com/user/repo.git
Switching to SVN and using https://github.com/user/repo.git leads to a different error ( https://github.com/user/repo.git : cannot open git-upload-pack).切换到 SVN 并使用https://github.com/user/repo.git会导致不同的错误( https://github.com/user/repo.git : 无法打开 git-upload-pack)。
I am very much at the end of every path I could find.我几乎在我能找到的每条道路的尽头。 Has anyone had similar issues?
有没有人遇到过类似的问题? I am working on a MacBook Pro using Matlab 2016b.
我正在使用 Matlab 2016b 在 MacBook Pro 上工作。
Thank you.谢谢你。
Here's what fixed it:这是修复它的内容:
(1) Set up a local Git repository (either through Matlab by going to Source Control > Manage files, and selecting Git integration OR using command line syntax) The address used for this is either git://github.com/username/repository.git (through Matlab) OR https://github.com/username/repository.git (through terminal) (1) 设置本地 Git 存储库(通过 Matlab 转到 Source Control > Manage files,然后选择 Git integration 或使用命令行语法) 用于此的地址是 git://github.com/username/repository .git(通过 Matlab)或https://github.com/username/repository.git (通过终端)
(2) Setup an SSH key for your system as described here (2) 按照此处所述为您的系统设置 SSH 密钥
(3) If not done so already during step 2, change the Git repository origin to the SSHaddress (git@github.com:username/repository) using git remote set-url origin git@github.com:username/repository.git (3) 如果在第 2 步中还没有这样做,请使用 git remote set-url origin git@github.com:username/repository.git 将 Git 存储库来源更改为 SSH地址(git@github.com:username/repository)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.