diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index 24bd93ba..1767bd26 100755 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -304,12 +304,25 @@ PURGEALL() # EE GIT Function EEGITINIT() { - # Initialise Git - echo -e "\033[34m Initialise Git On $EEGITDIR... \e[0m" + # Change Directory cd $EEGITDIR || OwnError "Unable To Change Directory $EEGITDIR" - git init || OwnError "Unable To Initialise Git On $EEGITDIR" - git add . && git commit -am "Initialise Git On $EEGITDIR" \ - || OwnError "Unable To Git Commit On $EEGITDIR" + + # Check .git + if [ ! -d .git ] + then + # Initialise Git + echo -e "\033[34m Initialise Git On $EEGITDIR... \e[0m" + git init || OwnError "Unable To Initialise Git On $EEGITDIR" + fi + + # Check For Untracked Files + git status | grep clean + if [ $? -ne 0 ] + then + # Add Files In Git Version Control + git add . && git commit -am "Initialise Git On $EEGITDIR" \ + || OwnError "Unable To Git Commit On $EEGITDIR" + fi } EEGITCOMMIT()