Main Content

gitrepo

Git repository 객체 만들기

R2023b 이후

    설명

    예제

    repo = gitrepo는 현재 작업 폴더에 Git™ 리포지토리에 대한 matlab.git.GitRepository 객체 repo를 만듭니다. repo를 사용하여 리포지토리를 프로그래밍 방식으로 조작할 수 있습니다.

    예제

    repo = gitrepo(folder)는 지정된 folder에 Git 리포지토리에 대한 matlab.git.GitRepository 객체 repo를 만듭니다.

    예제

    모두 축소

    Times Table App 프로젝트 리포지토리를 열고 repository 객체를 만듭니다.

    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)
        ModifiedFiles: [0×1 string]
       UntrackedFiles: [1×1 string]
               IsBare: 0
            IsShallow: 0
           IsDetached: 0
           IsWorktree: 0 

    지정된 폴더에 대한 repository 객체를 만듭니다.

    repo = gitrepo("newrepo\")
    repo = 
    
      GitRepository with properties:
    
         WorkingFolder: "C:\workSpace\newrepo"
             GitFolder: "C:\workSpace\newrepo\.git"
         CurrentBranch: [0×0 GitBranch]
            LastCommit: [0×0 GitCommit]
         ModifiedFiles: [0×1 string]
        UntrackedFiles: [2×1 string]
                IsBare: 0
             IsShallow: 0
            IsDetached: 0
            IsWorktree: 0

    입력 인수

    모두 축소

    함수가 리포지토리를 만드는 위치의 폴더 경로로, 문자형 벡터 또는 string형 스칼라로 지정됩니다.

    출력 인수

    모두 축소

    Git 리포지토리로, matlab.git.GitRepository 객체로 반환됩니다.

    버전 내역

    R2023b에 개발됨