How to Check if A Git Clone Has Been Done Already with JGit
问题 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. 回答1: This is the