Skip to content
On this page

Git

Module to generate git related entries.

branch

Generates a random branch name.

Available since v5.0.0

Returns: string

ts
faker.git.branch(): string
faker.git.branch() // => "hard-drive-quantify"
faker.git.branch() // 'feed-parse'

commitEntry

Generates a random commit entry.

Available since v5.0.0

Parameters

NameTypeDefaultDescription
options{ ... }{}

Options for the commit entry.

options.eol?'CRLF' | 'LF'

Choose the end of line character to use. Defaults to 'CRLF'. 'LF' = '\n', 'CRLF' = '\r\n'

options.merge?boolean

Set to true to generate a merge message line.

Returns: string

ts
faker.git.commitEntry(options: {
  eol: 'CRLF' | 'LF',
  merge: boolean
} = {}): string
faker.git.commitEntry() // => "commit dfcdcbc9de896d1f58abbbac8ec171e08cfb3dd...
faker.git.commitEntry()
// commit fe8c38a965d13d9794eb36918cb24cebe49a45c2
// Author: Mable Harvey <Cynthia_Quigley@yahoo.com>
// Date: Sat Feb 05 2022 15:09:18 GMT+0100 (Mitteleuropäische Normalzeit)
//
//     copy primary system

commitMessage

Generates a random commit message.

Available since v5.0.0

Returns: string

ts
faker.git.commitMessage(): string
faker.git.commitMessage() // => "generate multi-byte monitor"
faker.git.commitMessage() // 'reboot cross-platform driver'

commitSha

Generates a random commit sha (full).

Available since v5.0.0

Returns: string

ts
faker.git.commitSha(): string
faker.git.commitSha() // => "cdfcdcbc9de896d1f58abbbac8ec171e08cfb3dd"
faker.git.commitSha() // '2c6e3880fd94ddb7ef72d34e683cdc0c47bec6e6'

shortSha

Generates a random commit sha (short).

Available since v5.0.0

Returns: string

ts
faker.git.shortSha(): string
faker.git.shortSha() // => "cdfcdcb"
faker.git.shortSha() // '6155732'

Released under the MIT License.