Yazan Jaber
Yazan Jaber

Reputation: 2068

how to delete folder from git repo and remove it totally from history

I have this structure in my git repo

  Proj1/Dir1

  proj1/Dir2

  proj1/ Dir3

I want to delete dir1 and dir2 from the repo also from all history.

How can I achieve that?

Upvotes: 0

Views: 180

Answers (1)

voam
voam

Reputation: 1016

How about this?

git filter-branch --tree-filter 'rm -f -r --dry-run  Proj1/Dir1 proj1/Dir2' HEAD

remove the --dry-run part to do it for real.

Upvotes: 1

Related Questions