0
Git does not versioning empty folders, so only deleting the contents of the folder will cause it to quit versioning.
I created a file with a file at the root and two files in a folder:
In Git it is not enough to delete the files directly on the file system or disk, it is necessary to do this by deleting command:
git rm .\files\*.txt
The above command deletes all txt extension aquifers from the files folder. Note that I have not deleted the folder, nor directly from the directory.
Then I committed this change. The image below shows the commit and file listing in the repository, showing that the folder no longer exists.
To upload changes to Github just use the command:
git push origin master
Assuming your remote is origin and the branch is the master.
It is not necessary to use the force, because if there is no inconsistency between remote repository and location, deletion of files or folders do not require special permissions.
Tried to push?
– Ewerton Belo
what’s the difference to this forced push ? it re-writes all folders ? has some way to just delete the folder I want you to delete ?
– leonardo vita
I used push origin --force <branch> and it worked. thanks
– leonardo vita
Yes, Repo will be recreated. No problem brother, but it’s not normal to need --force. And it looks like the commit says "0 deletions". If it happens again, we’ll investigate.
– Ewerton Belo