Created
February 21, 2018 03:05
-
-
Save amjith/c8179e589f84b16894aae962d2fb0e39 to your computer and use it in GitHub Desktop.
git-open.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
I'm using ubuntu 16.04 and I'm wondering: where to put this
.sh
file?