V
V
Verg1l2015-01-20 18:15:57
git
Verg1l, 2015-01-20 18:15:57

How to delete a directory in Git?

I don't fully understand how to use the git rm command.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
P
Pavel, 2016-05-25
@fathom

If you accidentally commit an unnecessary file or folder to the git repository and have already done a push, then to remove all traces of this file or folder, including from the history, just run the command:
where PATH is the relative path to the file or folder.
After that run (to overwrite the change history):
git push origin master --force

V
Victor, 2015-01-20
@v_decadence

git rm -r myfolder
git commit -m "myfolder is deleted"

A
Alexander Bagirov, 2015-01-20
@alexbagirov

Don't need this. Just delete the directory using standard OS methods, and then do
and
Well and send the new code to the server, respectively.

N
Nikolai, 2018-03-23
@kolian89

git rm -r myfolder -f
git commit -m "myfolder is deleted"
git push

A
artrise, 2020-02-08
@artrise

First we write:
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch myfile' \
--prune-empty --tag-name-filter cat -- --all
myfile replace to the name of the file to be removed from the turnip. Then:
git push origin --force --all
git push origin --force --tags
Taken from: fkn.ktu10.com/?q=node/9739

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question