@coder11125/omg
v0.4.5
Published
Oh My Git - a friendly CLI wrapper for common git tasks
Maintainers
Readme
Oh My Git (omg)
Because git is powerful... and power corrupts absolutely.
omg is a friendly CLI wrapper that translates git's cryptic error messages into human speak. Built with commander, simple-git, chalk, and ora
Why omg?
Let's be honest: git is a time machine with a interface designed by someone who hates you.
fatal: not possible to fast-forward, aborting→ What?!error: Your local changes would be overwritten by merge→ But I just wanted to...CONFLICT (content): Merge conflict in src/index.js→ Why does this always happen on Friday?!
omg wraps all that angst into simple, friendly commands. It won't make git less confusing, but at least you'll have a friendlier error message to laugh at while you cry.
Install
Install globally from npm:
npm install -g @coder11125/omgThat exposes the omg binary on your PATH.
Usage
Commit
Stage all changes and commit in one step. Git makes this two commands because... reasons:
omg -c "message"💡 Pro tip: If you forget the
-mflag with regular git, you get thrown into Vim.omgwon't do that to you. You're welcome.
Checkout
Switch to an existing branch. Regular git uses git checkout which also restores files, detaches HEADs, and probably makes toast if you ask nicely. omg just switches branches:
omg --visit <branch>Status
Show a friendly summary of the current repository state. Unlike git status, which looks like a novel by Stephen King:
omg statusNo more reading 47 lines to figure out if you're on main or master. We just tell you.
Branch management
Git branches are like multiverse theory: cool in concept, terrifying when you have 47 of them and no idea where you are.
omg branch # list all local branches (* marks current)
omg branch -n <name> # create a new branch (stay on current)
omg branch -n <name> -s # create and switch to it
omg branch -d <name> # delete a branch (must be fully merged)Remote management
omg remote # list all remotes
omg remote <url> # add a new remote named "origin"
omg remote <url> <name> # add a new remote with a custom namePush
Share your code with the world (or your team, or just your future self wondering what you were thinking).
omg push # push current branch to its upstream remote/branch
omg push <remote> # push to specific remote
omg push origin -u main # set upstream branch while pushing
omg push -f # force push with lease (safer)⚠️
-fis--force-with-lease, not nuclear--force. We're trying to prevent "git push origin main --force" horror stories.
Pull
Download changes from remote. The -r flag uses rebase, which keeps history linear because merge commits are like littering in your git log:
omg pull # pull from upstream
omg pull <remote> # pull current branch from specific remote
omg pull -r # pull with rebase (cleaner history)Merge
Combine branches. Squash merging is like stuffing all your messy commits into one neat package so nobody knows how many times you "fixed the fix":
omg merge <branch> # merge branch into current
omg merge <branch> --squash # squash merge (hide the evidence)
omg merge --abort # abort ongoing merge (panic button)Rebase
Rebasing: for when you want to rewrite history like a politician. "I definitely wrote this feature in one perfect commit."
omg rebase <branch> # rebase current onto branch
omg rebase --continue # continue after resolving conflicts
omg rebase --abort # abort rebase (we've all been there)Stash
Stash: git's "hide your mess in the closet" feature. Your stashes will eventually become a time capsule of code you forgot existed.
omg stash # stash current changes (sweep under rug)
omg stash pop # pop most recent stash (hope you remember what's in there)
omg stash list # list all stashes (your abandoned children)
omg stash drop 0 # drop stash at index 0 (let go of the past)
omg stash apply 0 # apply stash but keep it ( commitment issues)Log
View commit history with pretty formatting. Finally, a log you can actually read without your eyes bleeding:
omg log # show last 10 commits
omg log -n 20 # show last 20 commits (journey into the past)
omg log --oneline # condensed format (for the lazy)
omg log -n 5 --oneline # last 5, one-line (just the highlights)Visualize
See the multiverse of branches in all its glory. Perfect for when you've merged so many things you're not sure which reality you're in anymore:
omg visualize # show a visual branch tree (the spaghetti detector)💡 Use this to see how your feature branches relate to main without needing a PhD in graph theory.
Diff
Review changes before committing. Because "I don't know what I changed" is not a valid excuse at standup:
omg diff # show unstaged changes (the "oops" detector)
omg diff --staged # show staged changes (what you're about to regret)
omg diff src/index.ts # show changes for specific fileBlame
Find out who broke that line of code. Perfect for passive-aggressive code reviews:
omg blame <file> # show line-by-line authorship
omg blame <file> -L 42 # show blame for specific line only
omg blame <file> --stats # show author statistics with heatmap💡 Pro tip: Use
--statsto see who really owns the file. Spoiler: it's probably you from 3 years ago wondering "what was I thinking?"
Clone
Make a local copy of someone else's beautiful disaster:
omg clone <url> # clone to default directory
omg clone <url> my-project # clone to custom directoryShip
🚢 It. Just. Works.
One command to rule them all: stage → commit → fetch → rebase → push. For when you're tired of typing the same 5 commands in a row.
omg ship "fix: handle null pointer" # commit and ship
omg ship # just sync and push (trust the process)
omg ship -n # dry run - see what would happen
omg ship --no-rebase # use merge instead of rebaseShip automatically:
- Stages uncommitted changes (even that console.log you forgot)
- Commits with your message (or judges you if you don't provide one)
- Fetches from remote (so you know if someone broke main)
- Rebases if you're behind (because merge bubbles are gross)
- Pushes to origin (send it!)
- Shows PR URL hint for GitHub remotes (you're welcome)
Oops
We all make mistakes. Git makes recovering from them feel like solving a Rubik's cube blindfolded. omg oops is your "undo" button for life:
omg oops # show recovery menu (the panic room)
omg oops uncommit # undo last commit, keep changes (take-backsies)
omg oops discard # undo last commit, discard changes (nuclear option)
omg oops unstage # unstage all staged files (stage fright)
omg oops unadd src/index.ts # unstage specific file (partial regret)
omg oops restore-branch # recover deleted branches (Lazarus mode)Sync
The "I just want to get back to main, pull, and go back to my branch without typing 47 commands" command:
omg sync # sync with main (full journey: stash → checkout → pull → prune → return → pop)
omg sync -b develop # sync with a different base branchSync does the hokey pokey:
- Stashes your mess (so it's safe)
- Switches to main (the promised land)
- Pulls latest (catch up on gossip)
- Prunes dead branches (spring cleaning)
- Returns to your feature branch (back to reality)
- Restores your stashed mess (welcome home)
Doctor
Git checkups: because prevention is better than "why is my repo on fire?!"
omg doctor # run health checks
omg doctor --fix # auto-fix issues where safeDoctor checks for:
- Uncommitted changes (your "I'll finish this later" pile)
- Staged but uncommitted files (the forgotten middle child)
- Branch behind/ahead status (are you lost?)
- No remote configured (coding into the void)
- Merge/rebase in progress (unfinished business)
- Detached HEAD state (you've gone full zombie)
- Binary files in commits (why is your .zip file 100MB?)
- Accumulating stashes (digital hoarding is still hoarding)
Combine flags
Flags can be combined in a single invocation, e.g. commit then switch:
omg -c "wip: refactor" --visit feature/new-thingOther
omg --help # show help
omg --version # show version (also -V)
omg --verbose # show detailed error output (show nerd errors)Update
Self-improvement for your CLI:
omg update # check for updates (be better than yesterday)Init
Start a new git repository. The first step on a long journey of merge conflicts:
omg init # initialize in current directory
omg init my-project # initialize in new directory
omg init -m "Initial commit" # initialize with first commitTag
Mark important moments in history. Like "v1.0.0" (aka "it barely works but marketing wants a release"):
omg tag # list all tags (milestones)
omg tag v1.0.0 # create lightweight tag
omg tag v1.0.0 -m "Release" # create annotated tag (fancy!)Fetch
Check what your coworkers broke while you were sleeping:
omg fetch # fetch from all remotes (the gossip gatherer)
omg fetch origin # fetch from specific remoteReset
Time travel with varying degrees of danger:
omg reset # unstage files (the "oops" fix)
omg reset --soft # keep changes staged (gentle)
omg reset --hard # discard all changes (point of no return ⚠️)⚠️
--hardis called that for a reason. There's no undo button for this one.
Revert
Undo a commit the right way (by making a new commit that undoes it). Unlike reset, this won't get you fired:
omg revert <commit> # revert a commit (professional take-backsies)
omg revert --continue # continue after resolving conflictsCherry-pick
Steal a commit from another branch. It's not really stealing if it's version control:
omg cherry-pick <commit> # apply commit from another branch (borrowed code)
omg cherry-pick --continue # continue after resolving conflictsConfig
Get or set git configuration:
omg config user.name # get current value
omg config user.name "John" # set valueSocial
See who's contributing to your repository (and who's doing all the work):
omg social # show contributor statisticsShows:
- All contributors with commit counts and percentages
- "Most helpful human" award for top contributor
- Humorous commentary about collaboration patterns
💡 Perfect for passive-aggressive code reviews or just satisfying your curiosity about who actually owns the codebase.
Whois
Investigate a specific contributor's footprint in the repository:
omg whois <username> # find commits by author name (partial match)Shows:
- Total commits and percentage of repo
- Files touched, lines added/deleted
- First and latest commit details
- Humorous commentary about their contribution level
💡 Supports partial matching -
omg whois johnfinds "John Doe", "Johnny Smith", etc. Multiple matches shows a summary list.
Spinner quips
While omg waits on git, loading spinners pick a random one-liner from a category that matches what you are doing (push, stash, ship, doctor, and so on). The silly bit is followed by a dim · and the real task so you still know what is happening:
$ omg status
⠋ Taking emotional inventory · Analyzing repository statusQuips live in src/quips.ts if you want to add your own trauma.
Verbose Mode (For the Curious)
By default, omg speaks human. When git throws a tantrum, we translate:
$ omg push
✖ Push failed
(OMG) 🤓 Nerd Error hidden: Run omg push -u origin main to solve itBut maybe you're a purist and want to see the raw git error. We support that too:
$ omg push --verbose
✖ Push failed
(OMG) 🤓 Nerd Error hidden: Run omg push -u origin main to solve it
Details:
fatal: The current branch main has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin main
To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.Use --verbose when you want to see git's full essay:
omg status --verbose # show detailed error output
omg push --verbose # show full git error messages
omg --verbose -c "message" # combine with other commands🤓 Fun fact: Git error messages were originally written to fit on punch cards. That's why they're so... concise.
Development
npm install
npm run build # compile TypeScript -> dist/
npm run typecheck # type-check without emitting
# try the CLI locally without publishing
npm link
omg --helpPhilosophy
"Git is a tool that lets you confidently delete code on Monday, regret it on Tuesday, and find it again on Wednesday.
omgjust makes the emotional rollercoaster more bearable."
Remember: omg won't make you a better developer. But it might make you a happier one. And isn't that what really matters?
Pro tip: If you ever feel overwhelmed by git, just remember: Linus Torvalds created git in 2005 because existing tools weren't painful enough. You're not the problem. Git is the problem.
🤝 Contributors
Thank you to all the amazing people who have helped build oh-my-git!
