Akshay
Akshay

Reputation: 52

How to delete the files/folder from git repository without deleting the Git history

I need to delete the outdated folder v1 from app/controllers/api folder. Now we have updated v2 folder inside api/controllers. But I need to preserve the v1 folder git history. Any help would be highly appreciated.

Upvotes: 0

Views: 164

Answers (2)

LBarry
LBarry

Reputation: 115

@bcmcfc is correct. You can simply delete the folder in your text editor, then commit then changes to your github. It will remove the folder from your Github repository, but the folder will still be available in your git version history. Hence the entire reason for version control software.

Upvotes: 1

bcmcfc
bcmcfc

Reputation: 26795

Committing the deletion of files does not affect the history.

Upvotes: 5

Related Questions