How to use the isomorphic-git.branch function in isomorphic-git

To help you get started, weโ€™ve selected a few isomorphic-git examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github casual-simulation / aux / WebClient / GitManager.ts View on Github external
async checkoutOrCreate(branchName: string): Promise {
        console.log(`[GitManager] Checking out "${this.localUserBranch}"...`);
        try {
            await this._checkout(branchName);
        } catch(err) {
            await branch({
                dir: this.projectDir,
                ref: branchName
            });

            await this._checkout(branchName);

            await push({
                dir: this.projectDir,
                ref: branchName,
                username: this.username,
                password: this.password
            });
        }
    }
github mizchi / next-editor / src / domain / git / commands / createBranch.ts View on Github external
export async function createBranch(
  projectRoot: string,
  newBranchName: string
): Promise {
  return git.branch({ dir: projectRoot, ref: newBranchName })
}
github mizchi / next-editor / src / lib / repository.ts View on Github external
export async function createBranch(
  projectRoot: string,
  newBranchName: string
): Promise {
  return git.branch({ fs, dir: projectRoot, ref: newBranchName })
}