Created
September 24, 2014 09:06
-
-
Save astrsk-hori/756005324f8961cda53e to your computer and use it in GitHub Desktop.
gitで変更があるファイルをpecoで絞ってscp
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/zsh | |
GST_LIST=$(git status -s|awk '{print $2}'|peco|tr '\n' ' ') | |
echo $GST_LIST | |
echo '上記ファイルを転送して良ければyes' | |
read ANSWER | |
if test ${ANSWER} = "yes"; then | |
echo $GST_LIST|xargs tar czvf -|ssh HOST_NAME "tar xzvf - -C ~/HOGE" | |
else | |
echo "処理を中止しました" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
peco使える前提。