Skip to content

Instantly share code, notes, and snippets.

@astrsk-hori
Created September 24, 2014 09:06
Show Gist options
  • Save astrsk-hori/756005324f8961cda53e to your computer and use it in GitHub Desktop.
Save astrsk-hori/756005324f8961cda53e to your computer and use it in GitHub Desktop.
gitで変更があるファイルをpecoで絞ってscp
#!/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
@astrsk-hori
Copy link
Author

peco使える前提。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment