如何使用Powershell检查git中是否存在未提交的更改?

时间:2018-09-12 15:56:53

标签: git powershell

我想编写一个Powershell脚本来评估git存储库是否未提交。

我有一个执行相同操作的bash脚本,如下所示:

git add .
if [ -n "$(git status --porcelain)" ]; then
    git commit -m "Committing the changes"
    git push origin master 
else
    echo "Nothing to commit";
fi

我应该如何评估Powershell中的if语句?

0 个答案:

没有答案
相关问题