git_operations.ts

Declarations
#

15 declarations

view source

git_add
#

git_operations.ts view source

(files: string | string[], options?: SpawnOptions | undefined): Promise<void>

Adds files to git staging area and throws if anything goes wrong.

files

type string | string[]

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_add_and_commit
#

git_operations.ts view source

(files: string | string[], message: string, options?: SpawnOptions | undefined): Promise<void>

Adds files and commits in one operation and throws if anything goes wrong.

files

type string | string[]

message

type string

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_check_clean_workspace_as_boolean
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<boolean>

Wrapper for gro's git_check_clean_workspace that returns a boolean.

options?

type SpawnOptions | undefined
optional

returns

Promise<boolean>

git_commit
#

git_operations.ts view source

(message: string, options?: SpawnOptions | undefined): Promise<void>

Commits staged changes with a message and throws if anything goes wrong.

message

type string

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_current_branch_name_required
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<string>

Wrapper for gro's git_current_branch_name that throws if null.

options?

type SpawnOptions | undefined
optional

returns

Promise<string>

git_current_commit_hash_required
#

git_operations.ts view source

(branch?: string | undefined, options?: SpawnOptions | undefined): Promise<string>

Wrapper for gro's git_current_commit_hash that throws if null.

branch?

type string | undefined
optional

options?

type SpawnOptions | undefined
optional

returns

Promise<string>

git_get_changed_files
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<string[]>

Returns list of changed files compared to HEAD.

options?

type SpawnOptions | undefined
optional

returns

Promise<string[]>

git_has_changes
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<boolean>

options?

type SpawnOptions | undefined
optional

returns

Promise<boolean>

git_has_file_changed
#

git_operations.ts view source

(from_commit: string, to_commit: string, file_path: string, options?: SpawnOptions | undefined): Promise<boolean>

from_commit

type string

to_commit

type string

file_path

type string

options?

type SpawnOptions | undefined
optional

returns

Promise<boolean>

git_has_remote
#

git_operations.ts view source

(remote?: string, options?: SpawnOptions | undefined): Promise<boolean>

remote

type string
default 'origin'

options?

type SpawnOptions | undefined
optional

returns

Promise<boolean>

git_push_tag
#

git_operations.ts view source

(tag_name: string, origin?: GitOrigin, options?: SpawnOptions | undefined): Promise<void>

Pushes a tag to origin and throws if anything goes wrong.

tag_name

type string

origin

type GitOrigin
default 'origin' as GitOrigin

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_stash
#

git_operations.ts view source

(message?: string | undefined, options?: SpawnOptions | undefined): Promise<void>

Stashes current changes and throws if anything goes wrong.

message?

type string | undefined
optional

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_stash_pop
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<void>

Applies stashed changes and throws if anything goes wrong.

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_switch_branch
#

git_operations.ts view source

(branch: GitBranch, pull?: boolean, options?: SpawnOptions | undefined): Promise<void>

Switches to a branch with safety checks and throws if workspace is not clean.

branch

type GitBranch

pull

type boolean
default true

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_tag
#

git_operations.ts view source

(tag_name: string, message?: string | undefined, options?: SpawnOptions | undefined): Promise<void>

Creates a git tag and throws if anything goes wrong.

tag_name

type string

message?

type string | undefined
optional

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

Imported by
#