https://github.com/igrep/git-aliases.nu
Launch Nushell with aliases for all git commands, inspired by git-sh.
https://github.com/igrep/git-aliases.nu
git nushell
Last synced: 5 months ago
JSON representation
Launch Nushell with aliases for all git commands, inspired by git-sh.
- Host: GitHub
- URL: https://github.com/igrep/git-aliases.nu
- Owner: igrep
- License: apache-2.0
- Created: 2024-11-16T06:39:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-01T04:25:29.000Z (about 1 year ago)
- Last Synced: 2026-01-14T23:14:04.416Z (5 months ago)
- Topics: git, nushell
- Language: Nushell
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-sh.nu
Configure aliases for all git subcommands so that you can use them without typing `git`. Inspired by [git-sh](https://rtomayko.github.io/git-sh/).
## Installation
Download from [GitHub](https://github.com/igrep/git-aliases.nu/raw/refs/heads/main/git-aliases.nu) and save it to your `PATH`, then `chmod +x` it.
## Usage
Just run `git-aliases.nu`, then the `nu` command starts with the aliases configured. Now you don't need to type `git` before the subcommands:
```nu
> git-aliases.nu
> branch
* main
> status
On branch main
Your branch is up to date with 'origin/main'.
...
```
And `git-aliases.nu` sets an environment variable `GIT_ALIASES_NU` to `true`. It's useful for switching the prompt. For example, you can add the following to your `$nu.env-path` (usually `~/.config/nushell/env.nu`):
```nu
def create_left_prompt [] {
if ($env.GIT_ALIASES_ENABLED? == true) {
return $"(left_prompt_when_git_aliases_enabled)\n:"
}
...
}
```
See `git-aliases.nu --help` for more.
## Known Issue
The `--prefix` option to the built-in commands is not working as expected. For example:
```nu
> nongit-rm --help
Error: nu::shell::nushell_failed_spanned
× Nushell failed: Can't run alias directly. Unwrap it first.
╭─[entry #3:1:1]
1 │ nongit-rm --help
· ────┬────
· ╰── originates from here
╰────
help: This shouldn't happen. Please file an issue: https://github.com/nushell/nushell/issues
```
I want to report this problem. But I'm not sure the definitive way to reproduce this...