How do you delete a file with gitPython?
repo.delete([file_to_delete])
says that there is no delete method.
How do you delete a file with gitPython?
repo.delete([file_to_delete])
says that there is no delete method.
The problem I had was that I was deleting the file from the repository but not the working tree. The answer is to do the following:
repo.index.remove([file_to_delete],working_tree = True)
Without the working_tree argument the file is left in the working tree even though it is not in the repository.
© 2022 - 2024 — McMap. All rights reserved.