GIT-REPL(1)

✨ NAME ✨

okay bestie, gather round β€” <pink>git-repl</pink> is a git read-eval-print-loop. yes it's literally a git REPL. no cap ✨


🌸 SYNOPSIS 🌸

git-repl

git-repl [command...]

πŸ’– DESCRIPTION πŸ’–

It's a git read-eval-print-loop, meaning you get to run git commands without typing 'git' every single time like some kind of peasant. πŸ’…

Commands can be prefixed with an exclamation mark (!) to be interpreted as a regular shell command. so if you're feeling chaotic, that's your moment πŸ¦‹

Any arguments to git repl will be taken collectively as the first command to execute in the repl. so it just... jumps straight in. iconic.

Type exit, quit, or q to end the repl session. Ctrl+D and Ctrl+C will also work β€” no judgment either way, she's flexible. πŸ’œ


πŸ‘‘ COMMANDS πŸ‘‘

  • <command> β€” gets interpreted as git <command>, obviously. that's the whole point of her. ✨
  • !<command> β€” gets interpreted as <command>, like, not through git. raw shell energy. 🐚
  • ls β€” the equivalent of git ls-files. short, sweet, slay. πŸŽ€
  • exit|quit|q β€” ends the repl session. bye bestie 🫢

🌈 CONFIGURATION 🌈

Commands entered in a repl session get saved to a history file and are available in future sessions, exactly like a shell or a programming language repl. ngl that part is very good of her. πŸ’–

By default, the global history file lives at ~/.local/state/git_extras_repl_history.

You can also 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 it will need to be added to the repo or global .gitignore. ⚠️ not optional, bestie, or git will be in your mentions forever.

# 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"

You can specify a default command to run when hitting enter:

git config --global git-extras.repl.on-enter-command "git status -sb"

You can configure which character is used at the end of the prompt (default >):

git config --global git-extras.repl.prompt-character "Β±"

You can specify the prefix for the prompt (default git):

git config --global git-extras.repl.prefix ""

You can have the name of the current git repo shown in the prompt (default false):

git config --global git-extras.repl.show-project-name "true"

πŸ’€ EXAMPLES πŸ’€

okay watch this:

$ 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

the !echo one? ate. πŸ”₯


πŸŽ€ AUTHOR πŸŽ€

Written by Tj Holowaychuk <tj@vision-media.ca>. 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. πŸ’…βœ¨


🌸 REPORTING BUGS 🌸

found a bug? spill it here πŸ‘‰ <https://github.com/tj/git-extras/issues> β€” she wants to hear all about it, fr fr.


πŸ¦‹ SEE ALSO πŸ¦‹

<https://github.com/tj/git-extras> β€” the mothership πŸ’–


k byeeee, this was Git Extras' git-repl(1), dated May 2026. go run some git commands without typing 'git' like the main character you are. 🫢✨

πŸ“¦ where this page comes from