shell脚本复制git中更新文件
cptopath="home/gitcopy/"
codebasepath="./"
mkdir -p "$cptopath"
echo "你要选择的复制的文件git命令:"
ls
read -p " 要查询复制的src路径是为 (input your path):" cmdpath
echo "git status -s $cmdpath > /home/hdscpfilelist.txt"
git status -s "$cmdpath" > /home/hdscpfilelist.txt
awk '{print substr($0,3)}' /home/hdscpfilelist.txt >/home/hdscpfilelistnew.txt && mv /home/hdscpfilelistnew.txt /home/hdscpfilelist.txt
sed 's/^[ \t]*//g' "/home/hdscpfilelist.txt" > /home/hdscpfilelist2.txt
# 删除行尾空格和tab
sed 's/[ \t]*$//g' "/home/hdscpfilelist2.txt"> /home/hdscpfilelist.txt
echo "将进行复制如下文件,退出vim后开始复制:"
vim /home/hdsjiaohuan/hdscpfilelist.txt < /dev/tty
ahdsgitcopy.sh