简体   繁体   中英

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. However, I cannot seem to get the Git integration to push my changes to the online repository. 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.

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

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).

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.

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)

(2) Setup an SSH key for your system as described here

(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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM