Delete the remote branch of the MATLAB project(Project used with MATLAB git)
5 次查看(过去 30 天)
显示 更早的评论
Version:MATLAB 2020b
Background:I found that in the MATLABgit project of 2020b, it is impossible to delete the branch of the remote repository. After querying the document, it is found in the 2024a version, there is a discardChanges (repo,files) function to achieve this function. Is there any way to achieve this function in the 202b version?
Even if I choose to delete the remote branch in the branch browser, I still get the remote branch I don't want every time I pull it back。
0 个评论
回答(1 个)
Shivani
2024-6-18
Hello @鸿彬
The function 'discardChanges' was introduced only in MATLAB R2024a and therefore you won't be able to access it in the previous releases. You can refer to the following MATLAB documentation page for more details on this: https://www.mathworks.com/help/matlab/ref/matlab.git.gitrepository.discardchanges.html#:~:text=Introduced%20in%20R2024a
However, you can prevent this behavior in MATLAB R2020b by configuring Git to prune remote removed branches by default. You can do so by running the following command in the MATLAB command prompt during the setup of Git Source Control:
!git config remote.origin.prune true
You can view this MATLAB documentation link for more information on setting up Git control: https://www.mathworks.com/help/matlab/matlab_prog/set-up-git-source-control.html
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Source Control 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!