Skip to main content

git-sync-js / commitAndSync

Module: commitAndSync

Table of contents​

Interfaces​

Functions​

Functions​

commitAndSync​

▸ commitAndSync(options): Promise<void>

git add . + git commit + git rebase or something that can sync bi-directional

Parameters​

NameType
optionsICommitAndSyncOptions

Returns​

Promise<void>

Defined in​

src/commitAndSync.ts:32


syncPreflightCheck​

▸ syncPreflightCheck(configs): Promise<void>

Check for git repo state, if it is not clean, try fix it. If not init will throw error. This method is used by commitAndSync and forcePull before they doing anything.

Parameters​

NameTypeDefault valueDescription
configsObjectundefined-
configs.defaultGitInfo?ObjectundefineddefaultGitInfo from ICommitAndSyncOptions
configs.defaultGitInfo.branchstring'main'-
configs.defaultGitInfo.emailstring'gitsync@gmail.com'-
configs.defaultGitInfo.gitUserNamestring'gitsync'-
configs.defaultGitInfo.remotestring'origin'-
configs.dirstringundefined-
configs.logDebug?(message: string, step: GitStep) => unknownundefined-
configs.logProgress?(step: GitStep) => unknownundefined-
configs.logger?ILoggerundefined-
configs.userInfo?IGitUserInfosundefineduserInfo from ICommitAndSyncOptions

Returns​

Promise<void>

Defined in​

src/commitAndSync.ts:196