How can I resolve the "malformed URL" error when clicking "pull / push" in the "Source Control" tab in MATLAB R2021a?
5 views (last 30 days)
Show older comments
MathWorks Support Team
on 25 Feb 2025
Answered: MathWorks Support Team
on 13 Mar 2025
When clicking "pull / push" in the "Source Control" tab in R2021a, I get the following error message
Unable to pull in changes:
malformed URL <WRONG_URL>:80
(Error code=-1, Error class = 12)
and <WRONG_URL> is not the remote URL of my Git repository.
This workflow used to work in R2020b. How can I resolve this issue?
Accepted Answer
MathWorks Support Team
on 25 Feb 2025
As of R2021a, we use a different library for Git. Its behavior matches command-line Git more closely and it will look up environment variables and items in the Git configuration. This error results from Git trying to communicate with the wrong remote URL. Refer to the steps below to resolve the error.
1. Check the environment variables
One reason for this error may be that an environment variable such as HTTP_PROXY / HTTPS_PROXY is set, so a good first step is to check the environment variables. You can check all environment variables by executing the following in the Windows Command Prompt:
set
Alternatively, you can check, modify, or delete environment variables in the Advanced System Settings. To open Advanced System Settings, search for it in the Start Menu. Then, you can access the list of environment variables in your system by clicking on the "Environment Variables..." button.
Deleting these environment variables should resolve the error.
2. Check the git config file
If the above environment variables are not set, "remote.origin.proxy" could be set in the git config file causing the same issue. Note that "remote.origin.proxy" will cause such an issue even if it is set equal to nothing. Running the following might resolve the error in this case:
git config --global --unset remote.origin.proxy
3. Set the NO_PROXY environment variable
In case some of the other applications you are using require the HTTP_PROXY / HTTPS_PROXY environment variables, you can set a new environment variable NO_PROXY to:
github.com,gitlab.com
You can set this environment variable in the "Environment Variables" window of the Advanced System Settings.
0 Comments
More Answers (0)
See Also
Categories
Find more on Source Control in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!