How do I remove a directory from a Git repository?

Remove directory from Git and local Checkout ‘master’ with both directories: git rm -r one-of-the-directories // This deletes from filesystem git commit . -m “Remove duplicated directory” git push origin <your-git-branch> (typically ‘master’, but not always) Remove directory from Git but NOT local To remove this directory from Git but not delete it entirely from … Read more

Delete file from zipfile with the ZipFile Module

The following snippet worked for me (deletes all *.exe files from a Zip archive): zin = zipfile.ZipFile (‘archive.zip’, ‘r’) zout = zipfile.ZipFile (‘archve_new.zip’, ‘w’) for item in zin.infolist(): buffer = zin.read(item.filename) if (item.filename[-4:] != ‘.exe’): zout.writestr(item, buffer) zout.close() zin.close() If you read everything into memory, you can eliminate the need for a second file. However, … Read more

Deleting a file in VBA

1.) Check here. Basically do this: Function FileExists(ByVal FileToTest As String) As Boolean FileExists = (Dir(FileToTest) <> “”) End Function I’ll leave it to you to figure out the various error handling needed but these are among the error handling things I’d be considering: Check for an empty string being passed. Check for a string … Read more

How to remove a directory from git repository?

Remove directory from git and local You could checkout ‘master’ with both directories; git rm -r one-of-the-directories // This deletes from filesystem git commit . -m “Remove duplicated directory” git push origin <your-git-branch> (typically ‘master’, but not always) Remove directory from git but NOT local As mentioned in the comments, what you usually want to … Read more