Documentation

rgit documentation

Everything you need to install rgit and use every command. New to rgit? Start with Installation and First steps.

Overview

rgit is a companion for git. It turns the everyday routine of committing, pushing, pulling, branching and setting up a project into short, safe commands.

  • One command for common jobs. rgit push stages, commits and pushes in one go.
  • Safe. rgit asks before it changes anything important, and it never throws away your uncommitted work.
  • Works everywhere. It is a single program for Windows, macOS and Linux, and it runs in any terminal.
  • Uses your git. Your logins, SSH keys and settings keep working as they are.

Installation

rgit needs git 2.23 or newer. You can check your version with git --version.

Windows

  1. Download rgit-windows-x64-setup.exe.
  2. Run it. Choose Install for me only (no administrator rights needed) or Install for all users.
  3. Keep Add rgit to the PATH ticked, so you can run rgit from any folder.
  4. Open a new terminal window and run rgit doctor.

If Windows shows “Windows protected your PC”, click More info and then Run anyway. This warning appears for new apps that are not yet widely downloaded.

Portable version: download rgit-windows-x64.exe, rename it to rgit.exe and put it in any folder on your PATH.

Silent installation, for scripts or IT departments:

rgit-windows-x64-setup.exe /VERYSILENT /SUPPRESSMSGBOXES /CURRENTUSER

macOS

Paste this into Terminal. It picks the right version for your Mac, checks the download and installs it:

curl -fsSL https://raw.githubusercontent.com/ettisafxrup/rgit/main/scripts/install.sh | sh

To install by hand, download rgit-macos-arm64 (Apple Silicon) or rgit-macos-x64 (Intel), then run:

chmod +x ~/Downloads/rgit-macos-arm64
sudo mv ~/Downloads/rgit-macos-arm64 /usr/local/bin/rgit
xattr -d com.apple.quarantine /usr/local/bin/rgit

Linux

Works on any distribution:

curl -fsSL https://raw.githubusercontent.com/ettisafxrup/rgit/main/scripts/install.sh | sh

The script installs to /usr/local/bin, or to ~/.local/bin if it can't write there. To choose the folder yourself, set RGIT_INSTALL_DIR before running it.

To install by hand, download rgit-linux-x64 or rgit-linux-arm64, then run:

chmod +x ~/Downloads/rgit-linux-x64
sudo mv ~/Downloads/rgit-linux-x64 /usr/local/bin/rgit

With Go

go install github.com/ettisafxrup/rgit/cmd/rgit@latest

First steps

  1. Check your setup. rgit doctor tells you if anything is missing, and how to fix it.
  2. Tell git who you are. rgit login saves the name and email that appear on your commits.
  3. Push some work. In a project folder, run rgit push "My first commit". If the folder isn't a git repository yet, rgit offers to create one and asks for the repository URL.

A typical day with rgit:

rgit pull                      # start from the latest code
rgit new feature/search        # make a branch for your work
rgit status                    # see what you've changed
rgit push "Add search box"     # commit and push it
rgit switch main               # go back to main
rgit cleanup                   # remove branches that are merged

Upgrading from 1.x

Run the new Windows installer. All your commands keep their names.

  • An all-users installation removes the old shell version automatically.
  • A per-user installation reminds you to remove the old version from Settings → Apps. Please do, or Git Bash may keep running the old version.

rgit userinfo still works. It is now called rgit whoami.

Uninstalling

  • Windows: Settings → Apps → rgit → Uninstall. rgit is removed from your PATH too.
  • macOS and Linux: delete the program, for example sudo rm /usr/local/bin/rgit.

How rgit works

rgit doesn't replace git. Every command runs the git that is already installed on your computer, in the right order and with safe options. This means:

  • Your credentials, SSH keys, hooks and git settings are used exactly as before.
  • You can mix rgit and plain git freely. Everything rgit does shows up in your normal git history.
  • rgit works from any folder inside a repository, not only from its top folder.

rgit shows its progress with small symbols:

SymbolMeaning
✓Something finished successfully
›rgit is about to do something, such as pulling or pushing
•Information
?A question for you
!A warning
✗An error

Questions & --yes

Some commands ask before they do something important. Yes/no questions show the default answer in capitals: [Y/n] means Enter answers “yes”, and [y/N] means Enter answers “no”. Questions with a suggested answer show it in brackets, and pressing Enter accepts it.

Add --yes (or -y) to any command to answer every yes/no question with “yes” and accept every suggested answer. This is handy in scripts:

rgit push -y "Nightly update"

--yes also says “yes” to warnings, for example when undoing a commit that is already pushed. Use it when you know what the command will do.

Global options

These work with every command, anywhere on the line:

OptionWhat it does
-y, --yesAnswer “yes” to every question and accept suggested answers
--no-colorTurn off colors. Setting the NO_COLOR environment variable does the same.
-h, --helpShow help for the command
-v, --versionPrint the rgit version
--Treat everything after it as text, for example rgit push -- "-1 bug"

Colors turn off automatically when the output goes to a file or another program.

Exit codes

CodeMeaning
0Success
1Something failed, or you answered “no” to a question
2The command was typed incorrectly, for example with too many arguments or an unknown option

Everyday commands

rgit push

Usage rgit push [message]Alias p

Stages, commits and pushes all your changes in one step. Quotes around the message are optional.

What it does

  1. If the folder isn't a git repository, it asks to create one. New repositories start on the branch main.
  2. If there is no remote, it asks for a name (origin by default) and the repository URL. You can type a full URL or GitHub's short form owner/repo.
  3. In a brand-new repository, it matches the branch name the remote already uses, such as main or master.
  4. It lists your changed files and asks whether to stage them all.
  5. It commits them with your message. Without a message, it asks for one, and pressing Enter uses “Update <today's date>”.
  6. It pulls the latest remote changes and puts your commit on top, so the push isn't rejected.
  7. It pushes. The first push of a branch also links it to the remote branch.

Examples

rgit push "Fix the login redirect"
rgit push Add dark mode        # quotes are optional
rgit push -y                   # no questions; uses the default message

Good to know

  • If you answer “no” to staging, only what you had already staged is committed. If nothing was staged, rgit stops.
  • If there's nothing new to commit, rgit still pushes any commits that haven't been pushed yet.
  • If your files have merge conflicts, rgit stops and asks you to resolve them first.
  • If git doesn't know your name yet, rgit tells you to run rgit login.

rgit pull

Usage rgit pull [branch]

Gets the latest changes from the remote. Your commits are placed on top of them, which keeps history tidy. Uncommitted changes are set aside and put back automatically, so you never lose work.

  • Without a branch name, it pulls the branch you're on.
  • With a branch name, it pulls that branch from the remote into your current branch.
  • In a folder that isn't a repository yet, it offers to create one, asks for the remote, and downloads its files.

Examples

rgit pull
rgit pull develop

If there are conflicts

When your changes and the remote changes touch the same lines, rgit stops and explains what to do. Fix the files, then run git add <file> and git rebase --continue. To cancel, run git rebase --abort.

rgit sync

Usage rgit sync

Brings your current branch fully up to date in both directions. It pulls the remote changes and then pushes your own commits, without making a new commit. It's useful when you've committed with plain git and just want everything in sync.

rgit sync

rgit status

Usage rgit statusAlias st

Shows your repository on one clear screen:

  • Branch: the branch you're on, and whether it is up to date, has commits to push or pull, or hasn't been pushed yet.
  • Last commit: its short ID, message and age.
  • Remote: where your repository is pushed to.
  • Changes: how many files are staged, modified, new or in conflict, followed by the list of files.
  • Stash: how many stashed changes you have, if any.
rgit status

rgit log

Usage rgit log [-n count] [--all]Alias l

Shows recent commits as a compact, colorful graph, with the short ID, message, author, age and branch names.

OptionWhat it does
-n <count>How many commits to show (default: 15)
--allShow every branch, not just the current one
rgit log
rgit log -n 40 --all

rgit undo

Usage rgit undo

Takes back your last commit but keeps all of its changes staged. You can then fix the message, add a forgotten file, or split the work into smaller commits.

  • If the commit has already been pushed, rgit warns you first and the default answer is “no”. Undoing a pushed commit means the remote no longer matches your branch.
  • It also works on the very first commit of a repository.
  • It doesn't undo merge commits. For those, use git reset --merge HEAD~1.
rgit undo
rgit push "A better commit message"

Branch commands

rgit new

Usage rgit new <branch>Alias branch

Creates a new branch and switches to it. Your uncommitted changes come along. Without a name, rgit asks for one. Names are checked against git's rules, so a mistake like my..branch is caught straight away.

rgit new feature/login

The branch exists only on your computer until you run rgit push.

rgit switch

Usage rgit switch [branch]Aliases sw, checkout

Switches to another branch. Without a name, it shows a numbered list of your branches to pick from.

If the branch exists only on the remote, for example one a teammate pushed, rgit creates a local copy that stays linked to it.

rgit switch            # pick from a list
rgit switch main

rgit rename

Usage rgit rename <new> · <old>:<new> · <old> <new>Alias mv

Renames a branch. With just one name, the branch you're on is renamed.

If the old branch also exists on the remote, rgit asks whether to rename it there too. It pushes the new name first and only then deletes the old one, so nothing is lost if something goes wrong.

rgit rename feature/auth
rgit rename master:main
rgit rename old-name new-name

To rename your repository's default branch on GitHub, first change the default branch in the repository settings. GitHub won't delete the current default branch.

rgit cleanup

Usage rgit cleanup [base] [--prune]Alias clean

Deletes local branches whose work is already merged into the base branch. rgit shows you the list and asks before deleting anything.

  • The base branch is your repository's main branch (usually main or master), unless you name another one.
  • main, master, develop, the base branch and the branch you're on are never deleted.
  • Only branches on your computer are deleted. The remote isn't touched.
OptionWhat it does
--pruneFirst forget remote branches that were deleted on the server
rgit cleanup
rgit cleanup develop --prune

Project file commands

rgit ignore

Usage rgit ignore [preset | pattern]...

Adds entries to your .gitignore file, which tells git which files to leave out. rgit creates the file if needed and never adds the same entry twice.

  • Presets: ready-made lists for languages, editors and operating systems, such as node or vscode. See all presets.
  • Patterns: anything else you type is added as it is, for example "*.pem" or secrets/.
  • No arguments: rgit lists the files and folders in the current folder. Pick them by number, like 1,3,5-7, and then choose presets.
OptionWhat it does
--listShow the available presets
rgit ignore                         # pick from a list
rgit ignore go vscode windows
rgit ignore node "*.pem" tmp/

rgit license

Usage rgit license [license]

Creates a LICENSE file. Without a name, rgit shows a menu of 10 licenses. It then asks for the year (this year by default) and the copyright holder (your git name by default). Short names work too: mit, apache, gpl.

OptionWhat it does
--name <holder>The copyright holder, a person or organization
--year <year>The copyright year
rgit license
rgit license mit
rgit license apache-2.0 --name "Acme Inc." --year 2026

If a LICENSE file already exists, rgit asks before replacing it.

rgit readme

Usage rgit readme

Creates a README.md for your project by asking a few questions:

  1. The project title (the folder name by default).
  2. A short description.
  3. The command to run the project, such as npm run dev (optional).
  4. Your GitHub owner/repo. rgit skips this question when your remote is already on GitHub.
  5. If there's no LICENSE yet, whether to add one.

The README includes a description, setup steps, the project's folder structure, contribution guidelines and license information. If a README already exists, rgit asks before replacing it.

rgit readme

rgit archi

Usage rgit archiAlias tree

Saves your project's folder structure as a tree in a file called ARCHITECTURE.

  • Inside a git repository, it shows exactly the files git sees, so everything in .gitignore is left out.
  • Elsewhere, it skips common clutter such as hidden files, node_modules, build folders and log files.
OptionWhat it does
-o <file>Save to another file (default: ARCHITECTURE)
--depth <levels>Only go this many folders deep (0 means no limit)
--printShow the tree in the terminal instead of saving it
rgit archi
rgit archi --print --depth 2

Setup commands

rgit clone

Usage rgit clone <repository> [folder]

Downloads a repository. For GitHub, owner/repo is enough. Any other URL works as usual. The folder is named after the repository unless you choose a name.

rgit clone ettisafxrup/rgit
rgit clone https://gitlab.com/group/project.git my-folder

rgit login

Usage rgit login

Asks for your name and email and saves them as the identity used on your commits, for all repositories on this computer. rgit checks that the email looks valid.

Inside a repository with a remote, rgit also checks that you can reach it. If you can't, it helps you find out why.

rgit login

rgit whoami

Usage rgit whoamiAliases userinfo, me

Shows the name and email your commits are made with, and tells you if the current repository uses its own identity.

rgit whoami

rgit open

Usage rgit open [remote]Alias web

Opens your repository's web page in the browser. It works with GitHub, GitLab, Bitbucket and most other hosts. On GitHub, it opens the branch you're on.

rgit open
rgit open upstream

rgit doctor

Usage rgit doctor

Checks that everything is set up correctly and explains how to fix each problem it finds:

  • git is installed, and which version it is
  • your name and email are set
  • git can remember your password or token
  • rgit is on your PATH
  • inside a repository: you're on a branch, a remote is set, and there are no merge conflicts
rgit doctor

rgit version

Usage rgit version

Prints the rgit version and your system. rgit --version prints just the version number.

rgit version

rgit help

Usage rgit help [command]

Shows all commands, or detailed help with examples for one command. rgit <command> --help does the same. If you mistype a command, rgit suggests the closest match.

rgit help
rgit help push
rgit push --help

.gitignore presets

Use these names with rgit ignore. The other accepted names also work.

PresetForAlso accepted
nodeJavaScript and TypeScript projectsjs, javascript, ts, typescript
pythonPython projectspy
goGo projectsgolang
javaJava, Maven and Gradle projects
rustRust projects
dotnetC# and .NET projectscsharp, c#
cppC and C++ projectsc, c++
vscodeVisual Studio Code settingscode
jetbrainsIntelliJ, PyCharm, WebStorm and othersidea
windowsWindows system fileswin
macosmacOS system filesmac, osx
linuxLinux system files

Licenses

Use these names with rgit license.

NameLicense
mitMIT License
apache-2.0Apache License 2.0
gpl-3.0GNU General Public License v3.0
bsd-3-clauseBSD 3-Clause License
bsl-1.0Boost Software License 1.0
agpl-3.0GNU Affero General Public License v3.0
lgpl-3.0GNU Lesser General Public License v3.0
mpl-2.0Mozilla Public License 2.0
unlicenseThe Unlicense
cc-by-4.0Creative Commons Attribution 4.0

Troubleshooting

“rgit is not recognized” or “command not found”

Open a new terminal window. Terminals that were already open don't see PATH changes. On Windows, if it still doesn't work, run the installer again with Add rgit to the PATH ticked. On macOS and Linux, make sure the folder you installed to is on your PATH.

Git Bash runs the old rgit 1.x

Run type rgit to see which one Git Bash uses. Remove the old version from Settings → Apps.

“git does not know who you are yet”

Run rgit login once to set your name and email.

The push asks for a password or fails to sign in

Run rgit doctor to check whether git can store your credentials. GitHub no longer accepts account passwords for pushing, so use a personal access token, an SSH key, or the Git Credential Manager that comes with Git for Windows.

“The rebase stopped because of conflicts”

Your changes and the remote's changes touch the same lines. Open the files git lists, choose what to keep, then run git add <file> and git rebase --continue. To go back to how things were, run git rebase --abort.

macOS says rgit “cannot be opened”

Run xattr -d com.apple.quarantine /usr/local/bin/rgit once. The one-line installer does this for you.

Still stuck?

Open an issue on GitHub. Include what you ran and the output of rgit doctor.

Found a mistake in these docs? Let us know. Download rgit →