Skip to main content

git-sync-js / sync

Module: sync

Table of contents

Functions

Functions

commitFiles

commitFiles(dir, username, email, message?, filesToIgnore?, logger?): Promise<IGitResult>

Git add and commit all file

Parameters

NameTypeDefault value
dirstringundefined
usernamestringundefined
emailstringundefined
messagestring'Commit with Git-Sync-JS'
filesToIgnorestring[][]
logger?ILoggerundefined

Returns

Promise<IGitResult>

Defined in

src/sync.ts:17


continueRebase

continueRebase(dir, username, email, logger?, providedRepositoryState?): Promise<void>

try to continue rebase, simply adding and committing all things, leave them to user to resolve in the TiddlyWiki later.

Parameters

NameTypeDescription
dirstring
usernamestring
emailstring
logger?ILogger-
providedRepositoryState?stringresult of await getGitRepositoryState(dir, logger), optional, if not provided, we will run await getGitRepositoryState(dir, logger) by ourself.

Returns

Promise<void>

Defined in

src/sync.ts:118


fetchRemote

fetchRemote(dir, remoteName, branch?): Promise<void>

Simply calling git fetch.

Parameters

NameTypeDescription
dirstring-
remoteNamestring-
branch?stringif not provided, will fetch all branches

Returns

Promise<void>

Defined in

src/sync.ts:159


mergeUpstream

mergeUpstream(dir, branch, remoteName, userInfo?, logger?): Promise<IGitResult>

Git merge origin master

Parameters

NameType
dirstring
branchstring
remoteNamestring
userInfo?IGitUserInfos | IGitUserInfosWithoutToken
logger?ILogger

Returns

Promise<IGitResult>

Defined in

src/sync.ts:88


pushUpstream

pushUpstream(dir, branch, remoteName, userInfo?, logger?): Promise<IGitResult>

Git push -f origin master This does force push, to deal with --allow-unrelated-histories case

Parameters

NameType
dirstring
branchstring
remoteNamestring
userInfo?IGitUserInfos | IGitUserInfosWithoutToken
logger?ILogger

Returns

Promise<IGitResult>

Defined in

src/sync.ts:57