I learning git and using JGit to access Git repos from java code. Git by default does not allow to clone to a non-empty directory. How do we figure out that a git clone has already been done for a particular git repo in the local machine so that we can only do a Git pull subsequently?
Currently I'm using this approach:
if a root folder is existing in the specified location
clone has been done
pull
else
clone
Not sure if this is correct though. Any better ideas?
Thank you.