MATLAB Help Center
Remove remote from Git repository
Since R2025a
removeRemote(repo,remote)
removeRemote(repo,remote) removes the remote remote from the Git™ repository repo.
repo
remote
example
collapse all
Navigate to your repository folder and create a repository object.
repo = gitrepo;
Remove the remote fork.
fork
removeRemote(repo,"fork");
matlab.git.GitRepository
Git repository, specified as a matlab.git.GitRepository object.
matlab.git.GitRemote
Name or URL of the remote to remove, specified as a string scalar, a character vector, or a matlab.git.GitRemote object.
Example: "origin", 'https://github.com/my/repo'
"origin"
'https://github.com/my/repo'
Data Types: char | string
char
string
Introduced in R2025a
gitclone | gitrepo | commit | addRemote
gitclone
gitrepo
commit
addRemote
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office