Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 從所有 commit 中刪除特定檔案
- remove a file from a git repository with:
- ```
- git filter-branch --tree-filter 'rm file'
- ```
- remove a folder from a git repository with:
- ```
- git filter-branch --tree-filter 'rm -rf directory'
- ```
- This removes the directory or file from all the commits
- you can specify a commit by using:
- ```
- git filter-branch --tree-filter 'rm -rf directory' HEAD
- ```
- Or an range
- ```
- git filter-branch --tree-filter 'rm -rf vendor/gems' t49dse..HEAD
- ```
- To push everything to remote, you can do:
- ```
- git push origin master --force
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement