[英]Git push: Missing or invalid credentials. fatal: Authentication failed for 'https://github.com/username/repo.git'
[英]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
我最近開始使用 GitHub,因為我想與同事分享一些 Matlab 代碼。 但是,我似乎無法通過 Git 集成將我的更改推送到在線存儲庫。 我曾嘗試將 SVN 與https://github.com/user/repo.git集成,並將 Git 與 git://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
切換到 SVN 並使用https://github.com/user/repo.git會導致不同的錯誤( https://github.com/user/repo.git : 無法打開 git-upload-pack)。
我幾乎在我能找到的每條道路的盡頭。 有沒有人遇到過類似的問題? 我正在使用 Matlab 2016b 在 MacBook Pro 上工作。
謝謝你。
這是修復它的內容:
(1) 設置本地 Git 存儲庫(通過 Matlab 轉到 Source Control > Manage files,然后選擇 Git integration 或使用命令行語法) 用於此的地址是 git://github.com/username/repository .git(通過 Matlab)或https://github.com/username/repository.git (通過終端)
(2) 按照此處所述為您的系統設置 SSH 密鑰
(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.