简体   繁体   中英

Git removing files from future commits but keeping previous versions

Our git repository has become bloated with older unused files from previous versions.

I wish to remove the files from future pulls/clones but keep the files in the previous commits so they could be pulled if necessary.

It's not necessary to remove local versions if they are already on a users machine but if a new user pulls the repository then they shouldn't get any of the outdated files.

Is this possible and how would I go about doing this?

Thanks in advance!

You can delete the unused files what you said use git rm , and then the files will disappear from this commit. If you want to find them out, just reset to the old commit, or use the GUI tools.

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