Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
- [Показать название репозитория](#Показать-название-репозитория)
- [Generates a summary of pending changes](#generates-a-summary-of-pending-changes)
- [Сделать резервную копию неотслеживаемых файлов](#Сделать-резервную-копию-неотслеживаемых-файлов)
- [Навсегда удалить файл/директорию](#Навсегда-удалить-файлдиректорию)


<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
Expand Down Expand Up @@ -1175,5 +1176,16 @@ git request-pull v1.0 https://git.ko.xz/project master:for-linus
```sh
git ls-files --others -i --exclude-standard | xargs zip untracked.zip
```

### Навсегда удалить файл/директорию
Будут удалены файлы и коммиты. Вместо `<folder>` можно использовать регулярные выражения. Например, *.jpg
```sh
rm -rf <folder>
git commit -am 'remove files'
git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch <folder>' --prune-empty --tag-name-filter cat -- --all
rm -Rf .git/refs/original
rm -Rf .git/logs/
git gc --aggressive --prune=now
```
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->
9 changes: 7 additions & 2 deletions tips.json
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,12 @@
{
"title": "Сделать резервную копию неотслеживаемых файлов",
"tip": "git ls-files --others -i --exclude-standard | xargs zip untracked.zip"
}
},
{
"title": "Навсегда удалить файл/директорию",
"description": "Будут удалены файлы и коммиты. Вместо `<folder>` можно использовать регулярные выражения. Например, *.jpg",
"tip": "rm -rf <folder>\ngit commit -am 'remove files'\ngit filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch <folder>' --prune-empty --tag-name-filter cat -- --all\nrm -Rf .git/refs/original\nrm -Rf .git/logs/\ngit gc --aggressive --prune=now"
}
]
}
]
]