Skip to content

achoreim/gh-unpushed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gh-unpushed

A GitHub CLI extension that shows your unpushed Git commits.

Description

gh-unpushed is a simple extension for the GitHub CLI that shows which commits on your current branch haven't been pushed to the remote repository yet. This helps you keep track of local work that hasn't been shared with your team.

Installation

To install this extension:

gh extension install achoreim/gh-unpushed

Usage

gh unpushed [options] [remote]

Parameters

  • remote: (Optional) The name of the remote to compare against. Default: origin (or your configured default)

Options

  • --remote, -r <remote>: Override the default remote for this run
  • --set-remote, -sr <remote>: Set a new default remote for future runs
  • --help, -h: Show help message
  • --version : -v flag added, reads from VERSION file

Examples

Check unpushed commits to the default remote:

gh unpushed

Check unpushed commits to a specific remote:

gh unpushed upstream

Or:

gh unpushed --remote upstream

Set a new default remote:

gh unpushed --set-remote upstream

Output

The extension will display:

  • A success message if there are no unpushed commits
  • A list of unpushed commits with their hash, date, and commit message if there are any
  • An error message if you're not on a branch or if the remote branch doesn't exist

Example Output

🚀 Unpushed commits on 'feature' (not yet pushed to 'origin/feature'):

• 1a2b3c4 2025-04-09 12:30:00 Fixed critical bug in data fetching routine
• 5d6e7f8 2025-04-09 10:15:00 Added new logging functionality

Configuration

The extension stores your default remote preference in ~/.gh-unpushed-config. This configuration can be changed using the --set-remote option.

Requirements

  • GitHub CLI must be installed
  • Git must be installed

Development

To contribute to this extension:

  1. Clone the repository
    git clone https://github.com/achoreim/gh-unpushed.git
    cd gh-unpushed
  2. Make the script executable
    chmod +x gh-unpushed
  3. Create a symbolic link to make it available in your PATH
    gh extension install .

License

MIT License

Author

Created by @achoreim