A GitHub CLI extension that shows your unpushed Git commits.
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.
To install this extension:
gh extension install achoreim/gh-unpushed
gh unpushed [options] [remote]
remote
: (Optional) The name of the remote to compare against. Default:origin
(or your configured default)
--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 fromVERSION
file
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
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
🚀 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
The extension stores your default remote preference in ~/.gh-unpushed-config
. This configuration can be changed using the --set-remote
option.
- GitHub CLI must be installed
- Git must be installed
To contribute to this extension:
- Clone the repository
git clone https://github.com/achoreim/gh-unpushed.git cd gh-unpushed
- Make the script executable
chmod +x gh-unpushed
- Create a symbolic link to make it available in your PATH
gh extension install .
Created by @achoreim