MATLAB 帮助中心
创建 Git 存储库对象
自 R2023b 起
repo = gitrepo
repo = gitrepo(folder)
repo = gitrepo 为当前工作文件夹中的 Git™ 存储库创建一个 matlab.git.GitRepository 对象 repo。您可以使用 repo 以编程方式操作该存储库。
repo
matlab.git.GitRepository
示例
repo = gitrepo(folder) 为在指定的 folder 中的 Git 存储库创建一个 matlab.git.GitRepository 对象 repo。
folder
全部折叠
打开 Times Table App 工程存储库,并创建一个存储库对象。
openExample("matlab/TimesTableProjectExample") repo = gitrepo
repo = GitRepository with properties: WorkingFolder: "C:\myWorkSpace\examples\TimesTableProjectExample" GitFolder: "C:\myWorkSpace\examples\TimesTableProjectExample\.git" CurrentBranch: [1×1 GitBranch] (main) LastCommit: [1×1 GitCommit] (566d916) Remotes: [1×1 GitRemote] ModifiedFiles: [0×1 string] UntrackedFiles: [1×1 string] IsBare: 0 IsShallow: 0 IsDetached: 0 IsWorktree: 0
为指定的文件夹创建一个存储库对象。
repo = gitrepo("newrepo\")
repo = GitRepository with properties: WorkingFolder: "C:\workSpace\newrepo" GitFolder: "C:\workSpace\newrepo\.git" CurrentBranch: [0×0 GitBranch] LastCommit: [0×0 GitCommit] Remotes: [1×1 GitRemote] (origin https://github.com/my/repo ModifiedFiles: [0×1 string] UntrackedFiles: [2×1 string] IsBare: 0 IsShallow: 0 IsDetached: 0 IsWorktree: 0
函数为其创建 matlab.git.GitRepository 对象存储库文件夹的路径,指定为字符向量或字符串标量。
Git 存储库,以 matlab.git.GitRepository 对象形式返回。
在 R2023b 中推出
gitinit | gitclone | add | rm | commit
gitinit
gitclone
add
rm
commit
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处