Created
June 30, 2015 06:30
-
-
Save masawada/19c360bf83a2b66a39a0 to your computer and use it in GitHub Desktop.
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
SELECTED_FILE_TO_ADD="$(git status --porcelain | \ | |
sed '/^[A|UU|M]/d' | \ | |
peco | \ | |
awk -F ' ' '{print $NF}')" | |
if [ -n "$SELECTED_FILE_TO_ADD" ]; then | |
search_root=`git rev-parse --show-toplevel` | |
files=`echo "$SELECTED_FILE_TO_ADD" | tr '\n' ' '` | |
`cd ${search_root} && git add ${files}` | |
fi | |
echo "Added:" | |
for line in $SELECTED_FILE_TO_ADD | |
do | |
echo $line | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment