mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
* persistent command history
* notes
* decision on which commands to save
* configurable history location
* fix history initialization in various scenarios
* documentation
* comment
* don't add whitespace or consecutive duplicates to history
* fix manpage output
* Update bin/git-repl
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
* Update bin/git-repl
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
* Update git-repl
* Update bin/git-repl
* Apply suggestions from code review
* Add `extglob` and generate docs
* Fix regex
* update docs
rm man/git-repl.{1,html}
touch man/git-repl.md
make man/git-repl.{1,html}
---------
Co-authored-by: Edwin Kofler <edwin@kofler.dev>
85 lines
3 KiB
Groff
85 lines
3 KiB
Groff
.\" generated with Ronn-NG/v0.10.1
|
|
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
|
|
.TH "GIT\-REPL" "1" "February 2026" "" "Git Extras"
|
|
.SH "NAME"
|
|
\fBgit\-repl\fR \- git read\-eval\-print\-loop
|
|
.SH "SYNOPSIS"
|
|
\fBgit\-repl\fR
|
|
.P
|
|
\fBgit\-repl\fR [command\|\.\|\.\|\.]
|
|
.SH "DESCRIPTION"
|
|
Git read\-eval\-print\-loop\. Lets you run \fBgit\fR commands without typing 'git'\.
|
|
.P
|
|
Commands can be prefixed with an exclamation mark (!) to be interpreted as a regular shell command\.
|
|
.P
|
|
Any arguments to git repl will be taken collectively as the first command to execute in the repl\.
|
|
.P
|
|
Type \fBexit\fR, \fBquit\fR, or \fBq\fR to end the repl session\. Ctrl\-D and Ctrl\-C will also work\.
|
|
.SH "COMMANDS"
|
|
<command>
|
|
.P
|
|
Interpreted as \fBgit <command>\fR\.
|
|
.P
|
|
!<command>
|
|
.P
|
|
Interpreted as \fB<command>\fR (not through \fBgit\fR)\.
|
|
.P
|
|
ls
|
|
.P
|
|
Equivalent of 'git ls\-files'\.
|
|
.P
|
|
exit|quit|q
|
|
.P
|
|
Ends the repl session\.
|
|
.SH "CONFIGURATION"
|
|
Commands entered in a repl session will be saved to a history file and be available in future sessions, similar to a shell or programming language repl\. By default, the global history file is at \fB~/\.local/state/git_extras_repl_history\fR\. You can specify that your projects each have their own independent history file\. This file will be saved in \.git_repl_history at the top level of the repo, and will need to be added to the repo or global \.gitignore\.
|
|
.IP "" 4
|
|
.nf
|
|
# remove the \-\-global flag to configure only an individual project to have its own history file
|
|
git config \-\-global git\-extras\.repl\.use\-local\-history "true"
|
|
.fi
|
|
.IP "" 0
|
|
.P
|
|
You can specify a default command to run when hitting enter:
|
|
.P
|
|
\fBgit config \-\-global git\-extras\.repl\.on\-enter\-command "git status \-sb"\fR
|
|
.P
|
|
You can configure which character is used at the end of the prompt (default \fB>\fR):
|
|
.P
|
|
\fBgit config \-\-global git\-extras\.repl\.prompt\-character "±"\fR
|
|
.P
|
|
You can specify the prefix for the prompt (default \fBgit\fR): \fBgit config \-\-global git\-extras\.repl\.prefix ""\fR
|
|
.P
|
|
You can have the name of the current git repo shown in the prompt (default \fBfalse\fR):
|
|
.P
|
|
\fBgit config \-\-global git\-extras\.repl\.show\-project\-name "true"\fR
|
|
.SH "EXAMPLES"
|
|
.nf
|
|
$ git repl
|
|
git version 2\.34\.1
|
|
git\-extras version 7\.3\.0
|
|
Type 'ls' to ls files below current directory; '!command' to execute any command or just 'subcommand' to execute any git subcommand; 'quit', 'exit', 'q', ^D, or ^C to exit the git repl\.
|
|
|
|
git (master)> ls\-files
|
|
History\.md
|
|
Makefile
|
|
Readme\.md
|
|
bin/git\-changelog
|
|
bin/git\-count
|
|
bin/git\-delete\-branch
|
|
bin/git\-delete\-tag
|
|
bin/git\-ignore
|
|
bin/git\-release
|
|
|
|
git (master)> !echo Straight from the shell!
|
|
Straight from the shell!
|
|
|
|
git (master)> quit
|
|
.fi
|
|
.SH "AUTHOR"
|
|
Written by Tj Holowaychuk <\fItj@vision\-media\.ca\fR>\. Updated by Wyatt S Carpenter to add display of the previous command's exit status, 'q', and the ability to pass in the initial command as arguments\.
|
|
.SH "REPORTING BUGS"
|
|
<\fIhttps://github\.com/tj/git\-extras/issues\fR>
|
|
.SH "SEE ALSO"
|
|
<\fIhttps://github\.com/tj/git\-extras\fR>
|