Clone git repository without history

Last modified 2 years ago
Danger icon
The last modifications of this post were around 2 years ago, some information may be outdated!
On this page
  1. Summary
  2. Code

Summary

Sometimes you need to copy a repository and remove the history.

Code

git filter-branch --index-filter 'git rm --cached --ignore-unmatch [file_name]' HEAD