/
hubbitus
/
shell.scripts
Обзор
Документация
Войти
/
hubbitus
/
shell.scripts
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
git.filter
21 строка
777 B
Pavel Alexeev
Add debug possibility into git.filter
23 окт 2019, 00:05
23 окт 2019, 00:05
6dac2e8
Код
Авторство
О чём код?
#!/bin/bash #set -x : ${1?"Not enough arguments: `basename $0` filter-regex-of-files-LEAVE-in-project F.e. filter may be like: '^SPECS/zram.spec$', or just: 'zram' if you want simple match in any part of path. If you wish opposite behaviour - see git.filter.out script"} # Debug: # | xargs -0 -r -I{} bash -c "F=\"{}\"; echo \"Process file deletion [\$F]\", GIT_COMMIT=\$GIT_COMMIT; git rm --cached -r -- \"\$F\"" # http://stackoverflow.com/questions/5998987/splitting-a-set-of-files-within-a-git-repo-into-their-own-repository-preserving git filter-branch -f \ --prune-empty \ --index-filter ' git ls-tree -z -r --name-only --full-tree $GIT_COMMIT \ | egrep -z -v "'$1'" \ | xargs -0 -r git rm --cached -r ' \ -- \ --all