我是Git的新手。保存Git推送到輸出文件
我的問題是,使用shell腳本(在Windows中運行),我需要將Git Push命令保存到輸出文件。
到目前爲止,我已經是這樣的:
echo -e "\n6) ${GREEN}Starting Push.${NC}"
git push -v >> logs/logPush.log
if grep -q -w -i "Rejected" logs/logPush.log ;
then
echo "${RED}A conflict has been detected. Exiting.${NC}"
read
exit
else
:
fi
但它總是產生一個空白文件。拉作品就好壽...
有誰知道如何使輸出文件收到它出現在終端上的全部信息:
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 289 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To ssh:repository
42be914..ead1f82 master -> master
updating local tracking ref 'refs/remotes/origin/master'
非常感謝你的完整示例! – Manddy