summaryrefslogtreecommitdiff
path: root/man/man1/giteval.1
blob: 681343283ac0d30ccf1d79128e6f85bd32c99032 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.TH giteval 1 2023-02-11 utils

.SH NAME
giteval \- print name and state of current git branch

.SH SYNOPSIS
.B giteval

.SH DESCRIPTION
.B giteval
is intended to be used for the shell prompt,
to display the name of the current branch,
colour-coded for the current state of the branch.

It can be used as a command of its own,
but it is not as useful that way,
because its output is intended to be interpreted
by the shell's prompt formatter.

.SH EXAMPLES
For
.BR bash (1):
.RS
.EX
PROMPT_COMMAND='git_branch=$(giteval)'
PS1='\eu@\eh:\ew${git_branch@P}$'
.EE
.RE

.SH SEE ALSO
.BR git (1),\  git-branch (1),\  git-status (1),\  bash (1)