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 pushstages, 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
- Download rgit-windows-x64-setup.exe.
- Run it. Choose Install for me only (no administrator rights needed) or Install for all users.
- Keep Add rgit to the PATH ticked, so you can run rgit from any folder.
- 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 /CURRENTUSERmacOS
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 | shTo 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/rgitLinux
Works on any distribution:
curl -fsSL https://raw.githubusercontent.com/ettisafxrup/rgit/main/scripts/install.sh | shThe 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/rgitWith Go
go install github.com/ettisafxrup/rgit/cmd/rgit@latestFirst steps
- Check your setup.
rgit doctortells you if anything is missing, and how to fix it. - Tell git who you are.
rgit loginsaves the name and email that appear on your commits. - 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 mergedUpgrading 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:
| Symbol | Meaning |
|---|---|
✓ | 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:
| Option | What it does |
|---|---|
-y, --yes | Answer “yes” to every question and accept suggested answers |
--no-color | Turn off colors. Setting the NO_COLOR environment variable does the same. |
-h, --help | Show help for the command |
-v, --version | Print 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
| Code | Meaning |
|---|---|
0 | Success |
1 | Something failed, or you answered “no” to a question |
2 | The command was typed incorrectly, for example with too many arguments or an unknown option |
Everyday commands
rgit push
Stages, commits and pushes all your changes in one step. Quotes around the message are optional.
What it does
- If the folder isn't a git repository, it asks to create one. New repositories start on the branch
main. - If there is no remote, it asks for a name (
originby default) and the repository URL. You can type a full URL or GitHub's short formowner/repo. - In a brand-new repository, it matches the branch name the remote already uses, such as
mainormaster. - It lists your changed files and asks whether to stage them all.
- It commits them with your message. Without a message, it asks for one, and pressing Enter uses “Update <today's date>”.
- It pulls the latest remote changes and puts your commit on top, so the push isn't rejected.
- 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 messageGood 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
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 developIf 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
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 syncrgit status
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 statusrgit log
Shows recent commits as a compact, colorful graph, with the short ID, message, author, age and branch names.
| Option | What it does |
|---|---|
-n <count> | How many commits to show (default: 15) |
--all | Show every branch, not just the current one |
rgit log
rgit log -n 40 --allrgit 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
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/loginThe branch exists only on your computer until you run rgit push.
rgit switch
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 mainrgit rename
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-nameTo 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
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
mainormaster), 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.
| Option | What it does |
|---|---|
--prune | First forget remote branches that were deleted on the server |
rgit cleanup
rgit cleanup develop --pruneProject file commands
rgit ignore
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
nodeorvscode. See all presets. - Patterns: anything else you type is added as it is, for example
"*.pem"orsecrets/. - 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.
| Option | What it does |
|---|---|
--list | Show the available presets |
rgit ignore # pick from a list
rgit ignore go vscode windows
rgit ignore node "*.pem" tmp/rgit 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.
| Option | What 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 2026If a LICENSE file already exists, rgit asks before replacing it.
rgit readme
Creates a README.md for your project by asking a few questions:
- The project title (the folder name by default).
- A short description.
- The command to run the project, such as
npm run dev(optional). - Your GitHub
owner/repo. rgit skips this question when your remote is already on GitHub. - If there's no
LICENSEyet, 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 readmergit archi
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
.gitignoreis left out. - Elsewhere, it skips common clutter such as hidden files,
node_modules, build folders and log files.
| Option | What it does |
|---|---|
-o <file> | Save to another file (default: ARCHITECTURE) |
--depth <levels> | Only go this many folders deep (0 means no limit) |
--print | Show the tree in the terminal instead of saving it |
rgit archi
rgit archi --print --depth 2Setup commands
rgit clone
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-folderrgit 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 loginrgit whoami
Shows the name and email your commits are made with, and tells you if the current repository uses its own identity.
rgit whoamirgit open
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 upstreamrgit 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 doctorrgit version
Prints the rgit version and your system. rgit --version prints just the version number.
rgit versionrgit help
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.
| Preset | For | Also accepted |
|---|---|---|
node | JavaScript and TypeScript projects | js, javascript, ts, typescript |
python | Python projects | py |
go | Go projects | golang |
java | Java, Maven and Gradle projects | |
rust | Rust projects | |
dotnet | C# and .NET projects | csharp, c# |
cpp | C and C++ projects | c, c++ |
vscode | Visual Studio Code settings | code |
jetbrains | IntelliJ, PyCharm, WebStorm and others | idea |
windows | Windows system files | win |
macos | macOS system files | mac, osx |
linux | Linux system files |
Licenses
Use these names with rgit license.
| Name | License |
|---|---|
mit | MIT License |
apache-2.0 | Apache License 2.0 |
gpl-3.0 | GNU General Public License v3.0 |
bsd-3-clause | BSD 3-Clause License |
bsl-1.0 | Boost Software License 1.0 |
agpl-3.0 | GNU Affero General Public License v3.0 |
lgpl-3.0 | GNU Lesser General Public License v3.0 |
mpl-2.0 | Mozilla Public License 2.0 |
unlicense | The Unlicense |
cc-by-4.0 | Creative 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.
Nothing matches your search. Try another word.