Skip to content

Instantly share code, notes, and snippets.

@MJGTwo
Created June 23, 2019 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MJGTwo/7338a652eeeaa7fc6ce7682a1453f39c to your computer and use it in GitHub Desktop.
Save MJGTwo/7338a652eeeaa7fc6ce7682a1453f39c to your computer and use it in GitHub Desktop.
A more robust "git status" script I found years ago and keep at `/usr/local/bin/g`. `chmod +x` it and you're good to go.
#!/bin/bash
if [[ $(($RANDOM % 5)) = 0 ]]
then git fetch; clear; echo "Fetched";
else
clear;
fi
echo 'Branches:'
git branch;
echo ''
echo 'Last 5 log entries:';
git --no-pager log --oneline -n 5
echo ''
echo 'Stashes:';
git stash list;
echo ''
echo 'Status:';
git status;
# git notes
#
# Add a second remote machine (workstation)
# git remote add enterprise ssh://enterprise/code/infinum/iSpace/avisoAll
# git fetch
# git remote -v
# git checkout enterprise/branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment