MATLAB Answers

Every time I push to the remote GitHub repository, I have to re-input my username and password. Is there some way to avoid this by having MATLAB store this information?

319 ビュー (過去 30 日間)
It is convenient to have the Git support in MATLAB, but every time I push to the remote repository, I have to re-input my username and password. Is there some way to avoid this by having MATLAB store this information? When I use SourceTree to manage my Git repositories the account info is stored, but then SourceTree is not embedded in MATLAB. I would like to have the best of both.


MathWorks Support Team
MathWorks Support Team 2020 年 5 月 5 日
編集済み: MathWorks Support Team 2020 年 5 月 5 日
  5 件のコメント
HiWave 2020 年 7 月 29 日
@Dmitry Restarting the computer fixed that (assuming you have Git installed correctly)


その他の回答 (3 件)

埃博拉酱 2020 年 12 月 29 日
編集済み: MathWorks Support Team 2021 年 2 月 2 日
I tried all steps given by these two answers and the document on Didn't work at all. MATLAB just always asked me for username and password and nothing like Auth fail had ever appeared.
Finally I had to contact the technical support. They saw my remote repository URL like and told me to replace it with something like! All cleared.
These documents and answers all assume that you are familiar with the SSH-Git workflow and nobody has ever mentioned about the URL difference between SSH and HTTPS. I always thought a HTTPS URL + a SSH key are all I need to access the remote repository without username and password. Nowhere in all these did I see any serious instruction that a special SSH URL is required.
I post my experience here, hoping someone like me will see this and quickly get his job done. However, I also strongly suggest the MATLAB official to update their document on this. If it's too wordy to talk about SSH-Git workflow in the MATLAB document, at least I want a hint or a reference so that followers won't make similar mistakes and waste so much time confusing.
20210202 Update
The newly prereleased version R2021a now automatically remembers your username and password for HTTPS! Now you just need to input those stuff only once, and don't have to deal with those tricky SSH shit. Well done!
Now the best advice for newcomers suffering from old versions is: update to R2021a!
  3 件のコメント
Hank Xie
Hank Xie 2021 年 4 月 3 日
埃博拉酱, I can't thank you enough! I ran into the same issue and researched for a long time to no avail. Switching to git ssh url fixed it.


Jan Janse van Rensburg
Jan Janse van Rensburg 2019 年 3 月 8 日
If all else fails you can also try to regenerate your MATLAB preferences, you can refer to this link on how to do that.
  1 件のコメント
Dmitry Boltyanskiy
Dmitry Boltyanskiy 2019 年 9 月 28 日
It does not work. I can see " Auth fail" still, when I try to use SSH-authentication.


Jonah Pearl
Jonah Pearl 2020 年 7 月 22 日
I think the short answer here is, set up an SSH key instead of using the HTTPS method. NB, it is possible that you already have an SSH key and the SSH key requires using a passphrase, in which case the problem has just changed, not been solved. This second issue can also be solved, see How do I remove the passphrase for the SSH key without having to create a new key?.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by