createBranch
특정 커밋을 가리키는 새로운 브랜치를 생성해요.
시그니처
ts
class Repository {
createBranch(
branchName: string,
target: Commit,
options?: CreateBranchOptions | null | undefined,
): Branch;
}
파라미터
- branchName필수 · string
새로운 브랜치의 이름이에요.
- target필수 · Commit
이 브랜치가 가리킬 대상 커밋이에요.
- optionsnull | CreateBranchOptions
브랜치를 생성할 때의 옵션이에요.
- forceboolean
force
가 true면, 주어진 이름으로 이미 참조가 존재할 경우 그것이 대체돼요.
- forceboolean
반환 값
- Branch
새로 생성된 브랜치예요.