我有一個腳本,我需要採取不同的行動,如果有任何,這是一個或多個提交。做這個的最好方式是什麼?Git Bash腳本檢查回購是否有任何提交?
在僞代碼會是這個樣子..
#!/bin/bash
if [[ `git log_count` == "0" ]]; then
echo "No commits exist for this repo."
# Do stuff..
else
echo "One or more commits do exist!"
# Do other stuff
fi
任何想法?