Git nâng cao
Amanda Crawford-Adamo
Software and Data Engineer
Lệnh Git Filter-Repo
git filter-repo
Công cụ viết lại lịch sử Git nhanh và an toàn.
Mục đích
Cài git filter-repo bằng pip
pip install git-filter-repo
Xóa secrets.txt khỏi mọi commit
git filter-repo --path secrets.txt --invert-paths
Các bộ lọc liên quan
--path: chỉ định đường dẫn cần xử lý
--invert-paths: xử lý mọi đường dẫn trừ đường dẫn trong --path
Kết quả đầu ra
Parsed 150 commits
New history written in 0.10 seconds; now repacking/cleaning...
Repacking your repo and cleaning out old unneeded objects
Hệ quả chính
Trường hợp dùng
Mẹo
Git nâng cao