Skip to content

Instantly share code, notes, and snippets.

@rscata
Forked from amjith/git-open.sh
Created April 17, 2018 07:04
Show Gist options
  • Save rscata/3d1972f30e90b9c9a496b52d96e3a022 to your computer and use it in GitHub Desktop.
Save rscata/3d1972f30e90b9c9a496b52d96e3a022 to your computer and use it in GitHub Desktop.
git-open.sh
#!/bin/bash
dirty=`git status --porcelain -uno | sed s/^...//`
last_modified=`git show --pretty="format:" --name-only HEAD`
if [ -n "$dirty" ]; then
echo $dirty
else
echo $last_modified
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment