e-git-zain
v3.0.2
Published
π The ultimate CLI to automate your GitHub workflow. Simplified push, undo, redo, and history management.
Maintainers
Readme
β‘ Git-Easy (e-git)
v3.0.0 Β· The ultimate CLI to automate your entire GitHub workflow
Push, pull, branch, diff, stash, open PRs, auto-commit on schedule β all from one beautiful terminal tool.
π¦ Installation
npm install -g e-git-zainAfter install, two aliases are available:
e-git --help
git-easy --helpβ‘ Quick Start
e-git "your commit message"That's it β stages everything, commits, and pushes to your remote in one shot.
π Commands at a Glance
| Command | Description |
|---|---|
| e-git [message] | β‘ Stage β commit β push to GitHub |
| e-git branch | πΏ Interactive branch manager |
| e-git diff [-s] | π Visual colored diff |
| e-git pull [--rebase] | β¬οΈ Smart pull with auto-stash |
| e-git init | ποΈ Guided repo initialization wizard |
| e-git tag | π·οΈ Create & push semver release tags |
| e-git clone <url> [-d dir] | π₯ Smart clone with auto-install |
| e-git status | π Rich status dashboard |
| e-git stash | π¦ Interactive stash manager |
| e-git pr [--base branch] | π Open Pull Request in browser |
| e-git schedule [-i min] [-p prefix] | β±οΈ Auto-commit on file change or interval |
| e-git history | π Browse & restore past pushes (interactive) |
| e-git list | π Table view of push history |
| e-git undo | π Revert files to last pushed state |
| e-git redo | βοΈ Jump forward after an undo |
| e-git clear | π§Ή Clear local push history log |
| e-git credits | β¨ View the creators |
π Detailed Feature Reference
β‘ Push (Default Command)
e-git "feat: add login page"
e-git # will prompt for commit messageWhat happens step by step:
- Checks you're in a valid git repository
- Verifies a remote (
origin) exists β offers to add one if missing - Verifies GitHub authentication (offers GitHub CLI login or PAT guidance if it fails)
- Checks for a
.gitignorefile β offers to generate one from a checklist if missing - Scans for changed files and displays a color-coded preview:
- π΄
+Untracked new files - π‘
~Modified files - π’
βStaged files
- π΄
- Prompts for a commit message if none was provided
- Stages all files (
git add .) - Creates the commit
- Auto-detects if you're on
masterβ asks if you want to rename it tomainbefore pushing - Pushes with
--set-upstreamso tracking is always configured - Displays a success panel (boxen) showing:
- Branch name
- Short commit hash
- Commit message
- Time of push
- Logs the push to local history (for undo/redo/history commands)
Smart behaviors:
- If nothing has changed, exits cleanly with an info message
- If push fails, shows the full error detail
- Truncates file list display at 12 files with
+N morehint
πΏ Branch β Interactive Branch Manager
e-git branchOpens an interactive menu showing all local branches (with the current branch highlighted in green). Then presents these options:
| Action | What it does |
|---|---|
| Create new branch | Prompts for name, creates it, optionally switches to it immediately |
| Switch branch | Lists all other branches β select and switch in one step |
| Rename current branch | Prompts for a new name, renames in place |
| Delete a branch | Select from list, choose normal or force delete |
| Push current branch to remote | Pushes with --set-upstream so tracking is set |
| Exit | Returns to terminal |
Visual output: A boxen panel lists all branches before the menu appears, so you always know where you stand.
π Diff β Visual Colored Diff
e-git diff # show all working directory changes
e-git diff --staged # show only staged (index) changes
e-git diff -s # shorthand for --stagedOutput includes two sections:
- π Summary block β file-by-file stat line with
+additions (green) and-deletions (red) - π Full diff β line-by-line color coding:
- π’ Green β added lines
- π΄ Red β removed lines
- π΅ Cyan β hunk headers (
@@) - π‘ Yellow β diff file headers
- Gray β context lines
If there are no changes to show, exits with a clean βΉ No changes message.
β¬οΈ Pull β Smart Pull
e-git pull
e-git pull --rebase # pull using rebase strategy instead of mergeSmart stash workflow:
- Detects if you have unsaved local changes
- Auto-stashes them with a timestamped name before pulling
- Pulls from
origin/<current-branch> - Shows a pull summary panel (files changed, insertions, deletions)
- Automatically pops the stash to restore your work
Conflict detection:
- If the pull produces merge conflicts, lists every conflicting file with a π₯ warning
- Shows resolution tips:
- Edit files manually
- Run
git mergetool - Stage fixes and re-commit
ποΈ Init β Repo Initialization Wizard
e-git initFull guided setup β answers a few prompts then handles everything:
| Prompt | What it does |
|---|---|
| Project name | Defaults to current folder name |
| Short description | Used in generated README.md |
| Create initial commit? | Commits README + .gitignore as first commit |
| Add GitHub remote? | Optionally adds origin remote |
| Remote URL | If yes, adds remote and pushes first commit |
Auto-generated files:
README.mdβ pre-filled with project name and description.gitignoreβ pre-filled withnode_modules/,.env,dist/,build/,.DS_Store- Initializes on
mainbranch (notmaster)
End result panel shows: project name, branch, remote URL, and .gitignore status.
π·οΈ Tag β Release Tag Creator
e-git tagPerfect for npm package releases and versioning.
- Lists your last 8 existing tags before prompting
- Suggests the next version by auto-incrementing the last tag's patch number
- Asks for a tag message (release notes / changelog)
- Creates an annotated git tag (not a lightweight tag)
- Optionally pushes the tag to remote
End result panel shows: tag name, message, and whether it was pushed.
Example flow:
? New tag version (last: v1.2.3): v1.2.4
? Tag message: Fix auth bug and add dark mode
? Push tag to remote? Yes
β
Tag "v1.2.4" pushed!π₯ Clone β Smart Clone
e-git clone https://github.com/user/repo.git
e-git clone https://github.com/user/repo.git --dir my-project
e-git clone https://github.com/user/repo.git -d my-projectOptions:
| Flag | Description | Default |
|---|---|---|
| -d, --dir <dir> | Target folder name | Repository name |
After cloning:
- Detects if a
package.jsonexists in the cloned folder - Auto-runs
npm installif found and you confirm - Opens VS Code with
code <dir>if you confirm (requirescodein PATH)
End result panel shows: repo name, directory, dependency install status, and VS Code status.
π Status β Rich Status Dashboard
e-git statusEverything you need to know at a glance β all in one screen:
Top panel:
- Current branch name (bold cyan)
- Ahead / behind remote count (β green, β red)
- "Working tree clean" or file change count
File change section (color-coded by state):
- π’ Staged (index) files β ready to commit
- π‘ Modified (unstaged) files β edited but not staged
- π΄ Untracked files β new files not yet tracked
Recent commits section:
- Last 5 commits with short hash and message
- Most recent highlighted with a
βbullet
Runs git status and git log in parallel for maximum speed.
π¦ Stash β Interactive Stash Manager
e-git stashFull stash lifecycle in one interactive menu:
| Action | What it does |
|---|---|
| Save | Stashes all current changes with a custom name (defaults to stash-<timestamp>) |
| List | Shows all stashes with their index, name, and date |
| Pop | Restores the latest stash and removes it from the stash list |
| Apply | Pick a specific stash by index to apply without removing it |
| Drop | Pick a specific stash by index to permanently delete |
| Clear | Deletes ALL stashes (requires confirmation) |
| Exit | Returns to terminal |
Notes:
- Save shows the file count that was stashed
- List, Apply, and Drop show stash messages and timestamps
- Clear has a
default: falsesafety confirmation
π PR β Open Pull Request in Browser
e-git pr
e-git pr --base develop # open PR against a different base branchOptions:
| Flag | Description | Default |
|---|---|---|
| --base <branch> | The target (base) branch for the PR | main |
What it does:
- Reads your
originremote URL (supports both HTTPS and SSH[email protected]:formats) - Normalizes SSH URLs to HTTPS automatically
- Pushes your current branch to remote (with
--set-upstream) - Builds the GitHub compare URL:
github.com/<repo>/compare/<base>...<branch>?expand=1 - Displays a panel with repo, branch, base branch, and full PR URL
- Opens the URL in your default browser using the
openpackage
β±οΈ Schedule β Auto-Commit & Push
# File watch mode β auto-push 2 seconds after any file change
e-git schedule
# Interval mode β push every 30 minutes regardless of changes
e-git schedule --interval 30
e-git schedule -i 30
# Custom commit message prefix
e-git schedule --prefix "πΎ WIP save"
e-git schedule -p "backup"Options:
| Flag | Description | Default |
|---|---|---|
| -i, --interval <minutes> | Push every N minutes | (file watch mode) |
| -p, --prefix <msg> | Commit message prefix | β±οΈ Auto-save |
File watch mode (default):
- Uses
chokidarto watch the entire project directory - Ignores:
.git/,node_modules/,dist/,build/ - Has a 2-second debounce β waits for you to stop typing before committing
- Each auto-commit message:
<prefix> <HH:MM:SS>
Interval mode:
- Pushes on a timer regardless of whether files changed
- Only commits if there are actual changes (skips empty commits)
Both modes:
- Show a live spinner
π Watching for changesβ¦ - Display a success line for every auto-push with timestamp
- Press
Ctrl+Cto stop cleanly
π History β Interactive Push Browser
e-git historyBrowse every push you've made from this machine:
- Shows a paginated list (15 items/page) of all logged pushes with:
- Date & time
- Branch name (in green)
- Commit message
- Select any push to view its full diff (colored, with compact summary)
- From the detail view, choose:
- π Back β return to the list
- π°οΈ Restore β reset files to that exact state (with destructive warning)
- β Exit
π List β Table View of Push History
e-git listSimple, non-interactive table output showing all recorded pushes:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Date & Time Branch Message
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
5/5/2026, 9:02:30 AM main feat: add login page
5/4/2026, 8:45:10 PM main fix: auth bug
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββπ Undo β Revert to Last Push
e-git undoSafely rolls back your working directory:
- If HEAD matches the latest logged push β reverts to the one before that
- If HEAD is already behind β reverts to the most recent logged push
- Always shows what push you're reverting to (message + timestamp)
- Requires confirmation before the destructive
git reset --hard
βοΈ Redo β Jump Forward After Undo
e-git redoUndid too much? This brings you back:
- Finds your current HEAD in the push history
- Jumps to the push one step newer than the current state
- Shows a
β οΈ CRITICALextra warning if the target push is more than 30 minutes old - Requires confirmation before applying
π§Ή Clear β Wipe Push History
e-git clearDeletes the local push history file (.git/git-easy-history.json). Requires confirmation. This only affects the local log used by e-git history / undo / redo β it does not touch any git commits or remotes.
β¨ Credits
e-git creditsDisplays creator info, portfolio link, and learning resources.
ποΈ Project Structure
e-git-zain/
βββ index.js # Entry point β imports & registers all commands
βββ package.json
βββ lib/
β βββ git.js # simpleGit instance, auth check, remote setup, .gitignore helper
β βββ ui.js # banner, panel(), div(), badge(), fileIcon() β chalk/boxen helpers
β βββ history.js # historyPath(), readHistory(), writeHistory(), logPush()
βββ commands/
βββ push.js # Default push: stage β commit β push + success panel
βββ branch.js # Branch manager: create/switch/rename/delete/push
βββ diff.js # Visual diff: stat summary + full color diff
βββ pull.js # Smart pull: auto-stash β pull β restore + conflict report
βββ init.js # Init wizard: git init + README + .gitignore + first commit
βββ tag.js # Release tags: annotated tag + push
βββ clone.js # Smart clone: clone + npm install + VS Code open
βββ status.js # Status dashboard: branch/files/ahead-behind/commits
βββ stash.js # Stash manager: save/list/pop/apply/drop/clear
βββ pr.js # PR opener: build GitHub compare URL + open browser
βββ schedule.js # Auto-commit: chokidar file watcher or interval timer
βββ history.js # history (interactive) + list (table) + clear commands
βββ undoredo.js # undo + redo commandsπ οΈ Tech Stack
| Package | Purpose | |---|---| | commander | CLI argument parsing & subcommands | | simple-git | All git operations | | inquirer | Interactive terminal prompts | | chalk | Terminal colors & styling | | ora | Elegant loading spinners | | boxen | Rounded info panels | | open | Open URLs in default browser | | chokidar | Cross-platform file watcher |
π Authentication
e-git uses your system's existing git credentials. If authentication fails during a push, it offers three paths:
- GitHub CLI (
gh auth login) β recommended, interactive OAuth - Personal Access Token (PAT) β paste as password, generate at github.com/settings/tokens
- Abort β exit safely
π Notes
- Push history is stored locally at
.git/git-easy-history.json(inside.gitso it's never committed) - The tool always pushes to the
mainbranch by default. If you're onmaster, it will ask to rename it e-git scheduleblocks the terminal while running β use a separate terminal window or run it in the background
π¨βπ» Credits
Made with β€οΈ by Zain Ali
Community: mugha.dev community
Learning platform: m-learn.eu.cc
β¨ Join for more exclusive drops:
π WhatsApp Channel
π License
MIT Β© Zain Ali β see LICENSE for full text.
