remove-folder-and-its-contents-from-git with all History

27 views
Skip to first unread message

Guy Levkowitz

unread,
May 27, 2021, 8:12:36 AM5/27/21
to Repo and Gerrit Discussion
Hi All,

I need to remove some folder in one of the git repos, we need to remove all history of this folder , in all branches and all commits.

is there a good procedure to do that 
I have found some links on stackoverflow  - but when try to apply it get lots of error when try to push the change to Gerrit 

Do any of you have done it before ?

BR

Guy


Matthias Sohn

unread,
May 27, 2021, 11:14:02 AM5/27/21
to Guy Levkowitz, Repo and Gerrit Discussion
On Thu, May 27, 2021 at 2:12 PM Guy Levkowitz <sil...@gmail.com> wrote:
Hi All,

I need to remove some folder in one of the git repos, we need to remove all history of this folder , in all branches and all commits.

is there a good procedure to do that 
I have found some links on stackoverflow  - but when try to apply it get lots of error when try to push the change to Gerrit 

You can rewrite the history of a git repository using git-filter-repo [1]. Though this is pretty intrusive and
would break references from Gerrit metadata which is stored in notedb.
I don't know if there is a tool which can adapt these references to the rewritten history.
Without that I guess you'll face errors whenever you come across such a broken reference.


Do any of you have done it before ?

BR

Guy


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/66f77716-8ebd-4944-b41f-e2f30943b470n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages