简体   繁体   中英

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.

提交删除文件不会影响历史记录。

@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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM