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
Name | Type |
---|---|
options | ICommitAndSyncOptions |
Returns
Promise
<void
>
Defined in
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
Name | Type | Default value | Description |
---|---|---|---|
configs | Object | undefined | - |
configs.defaultGitInfo? | Object | undefined | defaultGitInfo from ICommitAndSyncOptions |
configs.defaultGitInfo.branch | string | 'main' | - |
configs.defaultGitInfo.email | string | 'gitsync@gmail.com' | - |
configs.defaultGitInfo.gitUserName | string | 'gitsync' | - |
configs.defaultGitInfo.remote | string | 'origin' | - |
configs.dir | string | undefined | - |
configs.logDebug? | (message : string , step : GitStep ) => unknown | undefined | - |
configs.logProgress? | (step : GitStep ) => unknown | undefined | - |
configs.logger? | ILogger | undefined | - |
configs.userInfo? | IGitUserInfos | undefined | userInfo from ICommitAndSyncOptions |
Returns
Promise
<void
>