I have a script that makes a clone of the repository I need. This script must be executed every day, i.e. reload data from the repository. There are no problems with cloning itself - the first launch downloads all the necessary files. But the next one knocks out this error.
stderr: 'fatal: destination path 'C:/Users/tred1/Desktop/WORK/анализатор/GHR_Y00011450/Data' already exists and is not an empty directory.
Those. I cannot clone a directory to a folder where it already exists. Which sounds pretty logical. I'm just learning how to work with git and sometimes I don't quite understand the commands.
Here is some of the code that does the cloning
class CloneProgress(RemoteProgress):
def update(self, op_code, cur_count, max_count=None, message=''):
pbar = tqdm(total=max_count)
pbar.update(cur_count)
def save (source, directory):
Repo.clone_from(source, directory, branch='master', progress=CloneProgress())
How can I update and add new files from this directory to bypass this error? Maybe there is some method?